Install-​Package

Installs one or more software packages.

Syntax

Install-Package
       [-AdditionalArguments <String[]>]
       [-AllVersions]
       [-Confirm]
       [-Credential <PSCredential>]
       [-Force]
       [-ForceBootstrap]
       [-Proxy <Uri>]
       [-ProxyCredential <PSCredential>]
       [-WhatIf]
       [<CommonParameters>]
Install-Package
       [-AdditionalArguments <String[]>]
       [-AllVersions]
       [-Confirm]
       [-Credential <PSCredential>]
       [-Force]
       [-ForceBootstrap]
       [-Proxy <Uri>]
       [-ProxyCredential <PSCredential>]
       [-WhatIf]
       [<CommonParameters>]
Install-Package
       [-AllVersions]
       [-AllowClobber]
       [-Command <String[]>]
       [-Confirm]
       [-Credential <PSCredential>]
       [-DscResource <String[]>]
       [-Filter <String>]
       [-Force]
       [-ForceBootstrap]
       [-Includes <String[]>]
       [-InstallUpdate]
       [-NoPathUpdate]
       [-PackageManagementProvider <String>]
       [-Proxy <Uri>]
       [-ProxyCredential <PSCredential>]
       [-PublishLocation <String>]
       [-RoleCapability <String[]>]
       [-Scope <String>]
       [-ScriptPublishLocation <String>]
       [-ScriptSourceLocation <String>]
       [-SkipPublisherCheck]
       [-Tag <String[]>]
       [-Type <String>]
       [-WhatIf]
       [<CommonParameters>]
Install-Package
       [-AllVersions]
       [-AllowClobber]
       [-Command <String[]>]
       [-Confirm]
       [-Credential <PSCredential>]
       [-DscResource <String[]>]
       [-Filter <String>]
       [-Force]
       [-ForceBootstrap]
       [-Includes <String[]>]
       [-InstallUpdate]
       [-NoPathUpdate]
       [-PackageManagementProvider <String>]
       [-Proxy <Uri>]
       [-ProxyCredential <PSCredential>]
       [-PublishLocation <String>]
       [-RoleCapability <String[]>]
       [-Scope <String>]
       [-ScriptPublishLocation <String>]
       [-ScriptSourceLocation <String>]
       [-SkipPublisherCheck]
       [-Tag <String[]>]
       [-Type <String>]
       [-WhatIf]
       [<CommonParameters>]
Install-Package
       [-AllVersions]
       [-AllowPrereleaseVersions]
       [-ConfigFile <String>]
       [-Confirm]
       [-Contains <String>]
       [-Credential <PSCredential>]
       [-Destination <String>]
       [-ExcludeVersion]
       [-FilterOnTag <String[]>]
       [-Force]
       [-ForceBootstrap]
       [-Headers <String[]>]
       [-Proxy <Uri>]
       [-ProxyCredential <PSCredential>]
       [-Scope <String>]
       [-SkipDependencies]
       [-SkipValidate]
       [-WhatIf]
       [<CommonParameters>]
Install-Package
       [-AllVersions]
       [-AllowPrereleaseVersions]
       [-ConfigFile <String>]
       [-Confirm]
       [-Contains <String>]
       [-Credential <PSCredential>]
       [-Destination <String>]
       [-ExcludeVersion]
       [-FilterOnTag <String[]>]
       [-Force]
       [-ForceBootstrap]
       [-Headers <String[]>]
       [-Proxy <Uri>]
       [-ProxyCredential <PSCredential>]
       [-Scope <String>]
       [-SkipDependencies]
       [-SkipValidate]
       [-WhatIf]
       [<CommonParameters>]
Install-Package
       [-AllVersions]
       [-Confirm]
       [-Credential <PSCredential>]
       [-Force]
       [-ForceBootstrap]
       [-IncludeSystemComponent]
       [-IncludeWindowsInstaller]
       [-Proxy <Uri>]
       [-ProxyCredential <PSCredential>]
       [-WhatIf]
       [<CommonParameters>]
Install-Package
       [-AllVersions]
       [-Confirm]
       [-Credential <PSCredential>]
       [-Force]
       [-ForceBootstrap]
       [-IncludeSystemComponent]
       [-IncludeWindowsInstaller]
       [-Proxy <Uri>]
       [-ProxyCredential <PSCredential>]
       [-WhatIf]
       [<CommonParameters>]
Install-Package
       [-InputObject] <SoftwareIdentity[]>
       [-AllVersions]
       [-Confirm]
       [-Credential <PSCredential>]
       [-Force]
       [-ForceBootstrap]
       [-Proxy <Uri>]
       [-ProxyCredential <PSCredential>]
       [-WhatIf]
       [<CommonParameters>]
Install-Package
       [-Name] <String[]>
       [-AllVersions]
       [-Confirm]
       [-Credential <PSCredential>]
       [-Force]
       [-ForceBootstrap]
       [-MaximumVersion <String>]
       [-MinimumVersion <String>]
       [-ProviderName <String[]>]
       [-Proxy <Uri>]
       [-ProxyCredential <PSCredential>]
       [-RequiredVersion <String>]
       [-Source <String[]>]
       [-WhatIf]
       [<CommonParameters>]

Description

The Install-Package cmdlet installs one or more software packages on the local computer.

Examples

Example 1: Install a package by package name

PS C:\> Install-Package -Name "DSCAccelerator" -Credential "CONTOSO\TestUser"

This command installs a package named DSCAccelerator. When you run this command, you are prompted to provide a password for the account that has rights to install the package.

Example 2: Install a package that you find with Find-Package

PS C:\> Find-Package "zoomit" | Install-Package

This command installs a package named zoomit by piping the package from a Find-Package command.

Example 3: Install packages by specifying a range of versions

PS C:\> Install-Package -Name "DSCAccel" -MinimumVersion 2.1.2 -MaximumVersion 2.2

This command installs any package that has a name matching the partial name DSCAccel. The command installs the newest version of the package, within a range of versions that is specified by adding the MinimumVersion and MaximumVersion parameters.

Required Parameters

-InputObject

Specifies a package by using the package's SoftwareIdentity type, which is shown in the results of the Find-Package cmdlet.

Type:SoftwareIdentity[]
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

Specifies one or more package names. Multiple names must be separated by commas.

Type:String[]
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-AdditionalArguments

Specifies one or more additional arguments for installation.

Type:String[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-AllVersions

Indicates that this cmdlet installs all available versions of the package. By default, Install -Package only installs the newest available version.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-AllowClobber

@{Text=}

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-AllowPrereleaseVersions

{{Fill AllowPrereleaseVersions Description}}

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Command

Specifies one or more commands for which Find-Package searches.

Type:String[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ConfigFile

{{Fill ConfigFile Description}}

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-Contains

{{Fill Contains Description}}

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Credential

Specifies a user account that has rights to install a package for a specified package provider or source.

Type:PSCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Destination

{{Fill Destination Description}}

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DscResource

Specifies one or more Desired State Configuration (DSC) resources for which Find-Package searches.

Type:String[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ExcludeVersion

{{Fill ExcludeVersion Description}}

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Filter

Specifies terms to search for within the Name and Description properties.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-FilterOnTag

{{Fill FilterOnTag Description}}

Type:String[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Force

Indicates that this cmdlet overrides restrictions that prevent the command from succeeding, as long as the changes do not compromise security.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ForceBootstrap

Forces PackageManagement to automatically install the package provider for the specified package.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Headers

{{Fill Headers Description}}

Type:String[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IncludeSystemComponent

Indicates that this cmdlet includes system components in the results.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IncludeWindowsInstaller

Indicates that this cmdlet includes the Windows installer in the results.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Includes

Specifies whether Find-Package should find all packages with DSC resources, cmdlets, functions, or workflows. The acceptable values for this parameter are:

  • Cmdlet
  • DscResource
  • Function
  • Workflow
Type:String[]
Parameter Sets:DscResource, Cmdlet, Function, Workflow, RoleCapability
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InstallUpdate

Indicates that this cmdlet installs updates.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MaximumVersion

Specifies the maximum allowed version of the package that you want to find. If you do not specify this parameter, Install-Package installs the finds the highest-numbered available version of the package.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MinimumVersion

Specifies the minimum allowed version of the package that you want to find. If you do not add this parameter, Install-Package finds the highest available version of the package that also satisfies any maximum specified version specified by the MaximumVersion parameter.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-NoPathUpdate

@{Text=}

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PackageManagementProvider

Specifies the name of the Package Management provider.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ProviderName

Specifies one or more package provider names to which to scope your package search. You can get package provider names by running the Get-PackageProvider cmdlet.

Type:String[]
Aliases:Provider
Parameter Sets:msi, NuGet, msu, Programs, PowerShellGet, psl, chocolatey
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Proxy

Specifies a proxy server for the request, rather than connecting directly to the Internet resource.

Type:Uri
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ProxyCredential

Specifies a user account that has permission to use the proxy server that is specified by the Proxy parameter.

Type:PSCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PublishLocation

Specifies a location for publishing the package.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RequiredVersion

Specifies the exact allowed version of the package that you want to install. If you do not add this parameter, Install-Package installs the newest available version of the package that also satisfies any maximum version specified by the MaximumVersion parameter.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RoleCapability

Specifies an array of role capabilities.

Type:String[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Scope

Specifies the scope to which to install the package. The acceptable values for this parameter are:

  • CurrentUser
  • AllUsers
Type:String
Parameter Sets:CurrentUser, AllUsers
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ScriptPublishLocation

Specifies the script publish location.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ScriptSourceLocation

Specifies the script source location.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SkipDependencies

{{Fill SkipDependencies Description}}

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SkipPublisherCheck

@{Text=}

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SkipValidate

{{Fill SkipValidate Description}}

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Source

Specifies one or more package sources. Multiple package source names must be separated by commas. You can get package source names by running the Get-PackageSource cmdlet.

Type:String[]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Tag

Specifies one or more strings to search for in the package metadata.

Type:String[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Type

Specifies whether to search for packages with a module, a script, or both. The acceptable values for this parameter are:

  • Module
  • Script
  • All
Type:String
Parameter Sets:Module, Script, All
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

SoftwareIdentity[]