The Install-Module command

The Install-Module command installs or updates modules from the PowerShell Gallery or any other configured repository. By default, Install-Module adds modules to the path for AllUsers, C:Program FilesWindowsPowerShellModules.

Access rights
Installing a module under the AllUsers scope requires a user account control administrator token (run as administrator).

For example, the posh-git module may be installed using either of the following two commands:

Find-Module posh-git | Install-Module 
Install-Module posh-git 

Modules may be installed under a user-specific path ($homeDocumentsWindowsPowerShellModules) using the Scope parameter:

Find-Module carbon -Scope CurrentUser 

If the most recent version of a module is already installed, the command ends without providing feedback. If a newer version is available that will be automatically installed alongside the original (in a folder named after the version if using PowerShell 5.0).

Reinstallation of an existing version can be forced with the following command:

Install-Module posh-git -Force 

The Install-Module command does not provide an option to install modules under the $PSHOME (%SystemRoot%System32WindowsPowerShellv1.0) directory. The $PSHOME path is reserved for modules created by Microsoft that are deployed with the Windows Management Framework (WMF) or the Windows operating system.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.60.63