Install Powershell Modules using Powershell

Опубликовано: 30 Сентябрь 2024
на канале: Code Doge
4,089
49

Please follow me on Twitter to get more updates on memes, tech news, devops/developer content!
  / codedoge4  

#powershell #modules #install

Important Time Stamps :

00:00 - Intro
00:12 - Create Function
00:22 - Create Parameters for the Function
00:48 - Use Get-Module -ListAvailable to view all the modules you already have installed
01:14 - If/else statement
01:40 - Import if module is installed OR Install Module then Import Module if module is not already installed
02:10 - Why we use -Force and -AllowClobber parameters
03:05 - Add Import-Module after Install Module
03:15 - Why we should put it in a Try Catch block
03:32 - Adding a try catch block into the function which will also help produce an accurate error message
04:58 - Example of how to call the function
05:15 - Example execution of running function to install a module, in this case, PSExcel module
06:36 - Running Get-Modules once again to show that we installed the powershell module
06:58 - Explaining how Get-Modules -ListAvailable actually shows the physical location of the module files
07:30 - Like, Subscribe, and leave a comment and share the video if it was helpful!

Thanks for watching!

In this video we cover a simple #script or #function that will allow us to pass any #powershell #module by name as a #parameter and #install as well as #import the module.
In addition we cover #Get-Module which will show you how to view what modules you already have installed as well as information such as what #directory they are physically located.

Ignore the below...

#installmodule #installpowershell #installpowershellmodule #installpsmodule #psmodule #powershellscripting #install-module #import-module #getmodle #viewmodule #scripting #errorhandling #exceptionmessage #trycatch #errormessage