Install-Package

Installs one or more software packages.
Install-Package [[-Name] [<String[]>]] [-AllVersions] [-Credential [<PSCredential>]] [-Force] [-ForceBootstrap][-MaximumVersion [<String>]] [-MinimumVersion [<String>]] [-ProviderName {Programs | msi | msu | PowerShellGet |nuget | chocolatey}] [-RequiredVersion [<String>]] [-Source [<String[]>]] [-Confirm] [-WhatIf] [<CommonParameters>]
Install-Package [-AdditionalArguments [<String[]>]] [-AllVersions] [-Confirm] [-WhatIf] [<CommonParameters>]
Install-Package [-AdditionalArguments [<String[]>]] [-AllVersions] [-Confirm] [-WhatIf] [<CommonParameters>]
Install-Package [-InputObject*] <SoftwareIdentity[]> [-AllVersions] [-Credential [<PSCredential>]] [-Force][-ForceBootstrap] [-Confirm] [-WhatIf] [<CommonParameters>]
Install-Package [-AllVersions] [-IncludeSystemComponent] [-IncludeWindowsInstaller] [-Confirm] [-WhatIf][<CommonParameters>]
Install-Package [-AllVersions] [-IncludeSystemComponent] [-IncludeWindowsInstaller] [-Confirm] [-WhatIf][<CommonParameters>]
Install-Package [-AllVersions] [-Command [<String[]>]] [-DscResource [<String[]>]] [-Filter [<String>]] [-Includes{DscResource | Cmdlet | Function | Workflow}] [-InstallUpdate] [-PackageManagementProvider [<String>]][-PublishLocation [<String>]] [-Scope {CurrentUser | AllUsers}] [-ScriptPublishLocation [<String>]][-ScriptSourceLocation [<String>]] [-Tag [<String[]>]] [-Type {Module | Script | All}] [-Confirm] [-WhatIf][<CommonParameters>]
Install-Package [-AllVersions] [-Command [<String[]>]] [-DscResource [<String[]>]] [-Filter [<String>]] [-Includes{DscResource | Cmdlet | Function | Workflow}] [-InstallUpdate] [-PackageManagementProvider [<String>]][-PublishLocation [<String>]] [-Scope {CurrentUser | AllUsers}] [-ScriptPublishLocation [<String>]][-ScriptSourceLocation [<String>]] [-Tag [<String[]>]] [-Type {Module | Script | All}] [-Confirm] [-WhatIf][<CommonParameters>]

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

Parameters
-AdditionalArguments [<String[]>]

Specifies one or more additional arguments for installation.

-AllVersions [<SwitchParameter>]

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

-Command [<String[]>]

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

-Credential [<PSCredential>]

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

-DscResource [<String[]>]

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

-Filter [<String>]

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

-Force [<SwitchParameter>]

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

-ForceBootstrap [<SwitchParameter>]

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

-Includes [<String[]>]

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

-IncludeSystemComponent [<SwitchParameter>]

Indicates that this cmdlet includes system components in the results.

-IncludeWindowsInstaller [<SwitchParameter>]

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

-InputObject <SoftwareIdentity[]>

  • This value is required
  • Accepts pipeline input ByValue

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

-InstallUpdate [<SwitchParameter>]

Indicates that this cmdlet installs updates.

-MaximumVersion [<String>]

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.

-MinimumVersion [<String>]

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.

-Name [<String[]>]

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

-PackageManagementProvider [<String>]

Specifies the name of the Package Management provider.

-ProviderName [<String[]>]

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.

-PublishLocation [<String>]

Specifies a location for publishing the package.

-RequiredVersion [<String>]

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.

-Scope [<String>]

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

— CurrentUser– AllUsers

-ScriptPublishLocation [<String>]

Specifies the script publish location.

-ScriptSourceLocation [<String>]

Specifies the script source location.

-Source [<String[]>]

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.

-Tag [<String[]>]

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

-Type [<String>]

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

— Module– Script– All

-Confirm [<SwitchParameter>]

  • Default value is false

Prompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.

-WhatIf [<SwitchParameter>]

  • Default value is false

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

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,ErrorAction, ErrorVariable, WarningAction, WarningVariable,OutBuffer, PipelineVariable, and OutVariable.

Outputs

SoftwareIdentity[]

Examples
  1. Install a package by package name:
    PS C:> Install-Package -Name "DSCAccelerator" -Credential "CONTOSOTestUser"
    

    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.

  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.

  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.

Related Links

Get-Package
Find-Package
Save-Package
Uninstall-Package