Install-Package

Installs one or more software packages.

Syntax

Install-Package
       [-Name] <String[]>
       [-RequiredVersion <String>]
       [-MinimumVersion <String>]
       [-MaximumVersion <String>]
       [-Source <String[]>]
       [-Credential <PSCredential>]
       [-Proxy <Uri>]
       [-ProxyCredential <PSCredential>]
       [-AllVersions]
       [-Force]
       [-ForceBootstrap]
       [-WhatIf]
       [-Confirm]
       [-ProviderName <String[]>]
       [<CommonParameters>]
Install-Package
       [-InputObject] <SoftwareIdentity[]>
       [-Credential <PSCredential>]
       [-Proxy <Uri>]
       [-ProxyCredential <PSCredential>]
       [-AllVersions]
       [-Force]
       [-ForceBootstrap]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
Install-Package
       [-Credential <PSCredential>]
       [-Proxy <Uri>]
       [-ProxyCredential <PSCredential>]
       [-AllVersions]
       [-Force]
       [-ForceBootstrap]
       [-WhatIf]
       [-Confirm]
       [-IncludeWindowsInstaller]
       [-IncludeSystemComponent]
       [<CommonParameters>]
Install-Package
       [-Credential <PSCredential>]
       [-Proxy <Uri>]
       [-ProxyCredential <PSCredential>]
       [-AllVersions]
       [-Force]
       [-ForceBootstrap]
       [-WhatIf]
       [-Confirm]
       [-IncludeWindowsInstaller]
       [-IncludeSystemComponent]
       [<CommonParameters>]
Install-Package
       [-Credential <PSCredential>]
       [-Proxy <Uri>]
       [-ProxyCredential <PSCredential>]
       [-AllVersions]
       [-Force]
       [-ForceBootstrap]
       [-WhatIf]
       [-Confirm]
       [-AdditionalArguments <String[]>]
       [<CommonParameters>]
Install-Package
       [-Credential <PSCredential>]
       [-Proxy <Uri>]
       [-ProxyCredential <PSCredential>]
       [-AllVersions]
       [-Force]
       [-ForceBootstrap]
       [-WhatIf]
       [-Confirm]
       [-AdditionalArguments <String[]>]
       [<CommonParameters>]
Install-Package
       [-Credential <PSCredential>]
       [-Proxy <Uri>]
       [-ProxyCredential <PSCredential>]
       [-AllVersions]
       [-Force]
       [-ForceBootstrap]
       [-WhatIf]
       [-Confirm]
       [-ConfigFile <String>]
       [-SkipValidate]
       [-Headers <String[]>]
       [-FilterOnTag <String[]>]
       [-Contains <String>]
       [-AllowPrereleaseVersions]
       [-Destination <String>]
       [-ExcludeVersion]
       [-Scope <String>]
       [<CommonParameters>]
Install-Package
       [-Credential <PSCredential>]
       [-Proxy <Uri>]
       [-ProxyCredential <PSCredential>]
       [-AllVersions]
       [-Force]
       [-ForceBootstrap]
       [-WhatIf]
       [-Confirm]
       [-ConfigFile <String>]
       [-SkipValidate]
       [-Headers <String[]>]
       [-FilterOnTag <String[]>]
       [-Contains <String>]
       [-AllowPrereleaseVersions]
       [-Destination <String>]
       [-ExcludeVersion]
       [-Scope <String>]
       [<CommonParameters>]
Install-Package
       [-Credential <PSCredential>]
       [-Proxy <Uri>]
       [-ProxyCredential <PSCredential>]
       [-AllVersions]
       [-Force]
       [-ForceBootstrap]
       [-WhatIf]
       [-Confirm]
       [-Scope <String>]
       [-PackageManagementProvider <String>]
       [-PublishLocation <String>]
       [-ScriptSourceLocation <String>]
       [-ScriptPublishLocation <String>]
       [-Type <String>]
       [-Filter <String>]
       [-Tag <String[]>]
       [-Includes <String[]>]
       [-DscResource <String[]>]
       [-RoleCapability <String[]>]
       [-Command <String[]>]
       [-AllowClobber]
       [-SkipPublisherCheck]
       [-InstallUpdate]
       [-NoPathUpdate]
       [<CommonParameters>]
Install-Package
       [-Credential <PSCredential>]
       [-Proxy <Uri>]
       [-ProxyCredential <PSCredential>]
       [-AllVersions]
       [-Force]
       [-ForceBootstrap]
       [-WhatIf]
       [-Confirm]
       [-Scope <String>]
       [-PackageManagementProvider <String>]
       [-PublishLocation <String>]
       [-ScriptSourceLocation <String>]
       [-ScriptPublishLocation <String>]
       [-Type <String>]
       [-Filter <String>]
       [-Tag <String[]>]
       [-Includes <String[]>]
       [-DscResource <String[]>]
       [-RoleCapability <String[]>]
       [-Command <String[]>]
       [-AllowClobber]
       [-SkipPublisherCheck]
       [-InstallUpdate]
       [-NoPathUpdate]
       [<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: 1
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: 1
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
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
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
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: Programs, msi, msu, PowerShellGet, nuget, chocolatey
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
-Proxy
Type: Uri
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProxyCredential
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
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
-SkipPublisherCheck
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[]