Get-Package

Returns a list of all software packages that have been installed by using Package Management.
Get-Package [[-Name] [<String[]>]] [-AdditionalArguments [<String[]>]] [-AllVersions] [-Force] [-ForceBootstrap][-MaximumVersion [<String>]] [-MinimumVersion [<String>]] [-ProviderName {Programs | msi | msu | PowerShellGet |nuget | chocolatey}] [-RequiredVersion [<String>]] [<CommonParameters>]
Get-Package [[-Name] [<String[]>]] [-AllVersions] [-Force] [-ForceBootstrap] [-IncludeSystemComponent][-IncludeWindowsInstaller] [-MaximumVersion [<String>]] [-MinimumVersion [<String>]] [-ProviderName {Programs |msi | msu | PowerShellGet | nuget | chocolatey}] [-RequiredVersion [<String>]] [<CommonParameters>]
Get-Package [[-Name] [<String[]>]] [-AllVersions] [-Force] [-ForceBootstrap] [-InstallUpdate] [-MaximumVersion[<String>]] [-MinimumVersion [<String>]] [-PackageManagementProvider [<String>]] [-ProviderName {Programs | msi |msu | PowerShellGet | nuget | chocolatey}] [-RequiredVersion [<String>]] [-Scope {CurrentUser | AllUsers}] [-Type{Module | Script | All}] [<CommonParameters>]

The Get-Package cmdlet returns a list of all software packages on the local computer that have been installed by using Package Management. You can run Get-Package on remote computers by running it as part of an Invoke-Command or Enter-PSSession command or script.

Parameters
-AdditionalArguments [<String[]>]

Specifies additional arguments.

-AllVersions [<SwitchParameter>]

Indicates that Get-Package returns all available versions of the package. By default, Get-Package only returns the newest available version.

-Force [<SwitchParameter>]

Forces the command to run without asking for user confirmation.

-ForceBootstrap [<SwitchParameter>]

Indicates that this cmdlet forces Package Management to automatically install the package provider.

-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.

-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 add this parameter, Get-Package finds the highest 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, Find-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, or package names with wildcard characters. Separate multiple package names with commas.

-PackageManagementProvider [<String>]

Specifies the name of the Package Management provider.

-ProviderName [<String[]>]

Specifies one or more package provider names. Separate multiple package provider names with commas.

-RequiredVersion [<String>]

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

-Scope [<String>]

Specifies the search scope for the package.

-Type [<String>]

Specifies whether to search for packages with a module, a script, or either.

<CommonParameters>

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

Outputs

SoftwareIdentity[]

Examples
  1. Get all installed packages:
    PS C:> Get-Package
    

    This command gets all packages that are installed on the local computer.

  2. Get packages that are installed on a remote computer:
    PS C:> Invoke-Command -ComputerName "server01" -Credential "CONTOSOTestUser" -ScriptBlock {Get-Package}
    

    This command gets a list of packages that were installed on a remote computer, server01, by using Package Management. When you run this command, you are prompted to provide credentials for the user CONTOSOTestUser.

  3. Get packages for a specified provider:
    PS C:> Get-Package -Provider "ARP"
    

    This command gets Add or Remove Programs software packages from the local computer.

  4. Get an exact version of a specific package:
    PS C:> Get-Package -Name "DSCAccelerator" -RequiredVersion "2.1.2"
    

    This command gets version 2.1.2 of a package named DSCAccelerator. Although only part of the package name has been specified, Get-Package should be able to find the DSCAccelerator package if there are no other packages with a name matching that pattern.

  5. Uninstall a package:
    PS C:> Get-Package -Name "DSCAccelerator" -RequiredVersion "2.1" | Uninstall-Package
    

    This command pipes the results of a Get-Package command to the Uninstall-Package cmdlet. In this example, you are uninstalling only version 2.1 of the DSCAccelerator package. You are prompted to confirm that you want to uninstall the package.

Related Links

Find-Package
Install-Package
Save-Package
Uninstall-Package
Invoke-Command
Enter-PSSession