GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing learn.microsoft.com — Install-Module (PowerShellGet) - PowerShell Note Access to this page requires authorization. You can try signing in or changing directories. Access to this page requires authorization. You can try changing directories. Install-Module
Downloads one or more modules from a repository, and installs them on the local computer. Syntax
Name
|
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
Overrides warning messages about installation conflicts about existing commands on a computer.
Overwrites existing commands that have the same name as commands being installed by a module.
AllowClobber and Force can be used together in an Install-Module command.
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
Allows you to install a module marked as a pre-release.
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
Prompts you for confirmation before running the Install-Module cmdlet.
| Type: | SwitchParameter |
| Default value: | False |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | cf |
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
Specifies a user account that has rights to install a module for a specified package provider or source.
| Type: | PSCredential |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
Installs a module and overrides warning messages about module installation conflicts. If a module
with the same name already exists on the computer, Force allows for multiple versions to be
installed. If there is an existing module with the same name and version, Force overwrites that
version. Force and AllowClobber can be used together in an Install-Module command.
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
Used for pipeline input. An error is thrown if a value supplied directly to InputObject. Use the pipeline to pass objects with the InputObject parameter.
| Type: | PSObject[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Position: | 0 |
| Mandatory: | True |
| Value from pipeline: | True |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
Specifies the maximum version of a single module to install. The version installed must be less than
or equal to MaximumVersion. If you want to install multiple modules, you can't use
MaximumVersion. MaximumVersion and RequiredVersion can't be used in the same
Install-Module command.
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
Specifies the minimum version of a single module to install. The version installed must be greater than
or equal to MinimumVersion. If there is a newer version of the module available, the newer
version is installed. If you want to install multiple modules, you can't use MinimumVersion.
MinimumVersion and RequiredVersion can't be used in the same Install-Module command.
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
Specifies the exact names of modules to install from the online gallery. A comma-separated list of
module names is accepted. The module name must match the module name in the repository. Use
Find-Module to get a list of module names.
| Type: | String[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Position: | 0 |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
When using the PassThru parameter, Install-Module outputs a PSRepositoryItemInfo object
for the module.
| Type: | SwitchParameter |
| Default value: | False |
| Supports wildcards: | False |
| DontShow: | False |
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
Specifies a proxy server for the request, rather than connecting directly to the Internet resource.
| Type: | Uri |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
Specifies a user account that has permission to use the proxy server that's specified by the Proxy parameter.
| Type: | PSCredential |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
Use the Repository parameter to specify the name of repository from which to download and
install a module. Used when multiple repositories are registered. Specifies the name of a registered
repository in the Install-Module command. To register a repository, use Register-PSRepository.
To display registered repositories, use Get-PSRepository.
| Type: | String[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
Specifies the exact version of a single module to install. If there is no match in the repository
for the specified version, an error is displayed. If you want to install multiple modules, you
can't use RequiredVersion. RequiredVersion can't be used in the same Install-Module
command as MinimumVersion or MaximumVersion.
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
Specifies the installation scope of the module. The acceptable values for this parameter are AllUsers and CurrentUser.
The AllUsers scope installs modules in a location that's accessible to all users of the computer:
$env:ProgramFiles\PowerShell\Modules
The CurrentUser installs modules in a location that's accessible only to the current user of the computer. For example:
$HOME\Documents\PowerShell\Modules
When no Scope is defined, the default is set based on the PowerShellGet version.
| Type: | String |
| Default value: | None |
| Accepted values: | CurrentUser, AllUsers |
| Supports wildcards: | False |
| DontShow: | False |
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
Allows you to install a newer version of a module that already exists on your computer. For example, when an existing module is digitally signed by a trusted publisher but the new version isn't digitally signed by a trusted publisher.
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
Shows what would happen if an Install-Module command was run. The cmdlet isn't run.
| Type: | SwitchParameter |
| Default value: | False |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | wi |
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Find-Module creates PSRepositoryItemInfo objects that can be sent down the pipeline to
Install-Module.
When using the PassThru parameter, Install-Module outputs a PSRepositoryItemInfo object
for the module. This is the same information that you get from the Find-Module cmdlet.
PowerShell includes the following aliases for Install-Module:
inmoInstall-Module runs on PowerShell 5.0 or later releases, on Windows 7 or Windows 2008 R2 and later
releases of Windows.
Important
As of April 2020, the PowerShell Gallery no longer supports Transport Layer Security (TLS) versions 1.0 and 1.1. If you aren't using TLS 1.2 or higher, you will receive an error when trying to access the PowerShell Gallery. Use the following command to ensure you are using TLS 1.2:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
For more information, see the announcement in the PowerShell blog.
As a security best practice, evaluate a module's code before running any cmdlets or functions for the first time. To prevent running modules that contain malicious code, installed modules aren't automatically imported after installation.
If the module name specified by the Name parameter doesn't exist in the repository,
Install-Module returns an error.
To install multiple modules, use the Name parameter and specify a comma-separated array of
module names. If you specify multiple module names, you can't use MinimumVersion,
MaximumVersion, or RequiredVersion. Find-Module creates PSRepositoryItemInfo objects
that can be sent down the pipeline to Install-Module. The pipeline is another way to specify
multiple modules to install in a single command.
By default, modules for the scope of AllUsers are installed in
$env:ProgramFiles\PowerShell\Modules. The default prevents confusion when you install PowerShell
Desired State Configuration (DSC) resources.
A module installation fails and can't be imported if it doesn't have a .psm1, .psd1, or .dll
of the same name within the folder. Use the Force parameter to install the module.
If an existing module's version matches the name specified by the Name parameter, and the
MinimumVersion or RequiredVersion parameter aren't used, Install-Module silently continues
but doesn't install the module.
If an existing module's version is greater than the value of the MinimumVersion parameter, or
equal to the value of the RequiredVersion parameter, Install-Module silently continues but
doesn't install the module.
If the existing module doesn't match the values specified by the MinimumVersion or
RequiredVersion parameters, an error occurs in the Install-Module command. For example, if the
version of the existing installed module is lower than the MinimumVersion value or not equal to
the RequiredVersion value.
Install-Module also installs any dependent modules specified as required by the module publisher.
The publisher lists the required modules and their versions in the module manifest.
PowerShellGet
Was this page helpful?