Get-Package

Returns a list of all software packages that have been installed by using Package Management.

Syntax

Get-Package
   [[-Name] <String[]>]
   [-RequiredVersion <String>]
   [-MinimumVersion <String>]
   [-MaximumVersion <String>]
   [-AllVersions]
   [-Force]
   [-ForceBootstrap]
   [-ProviderName <String[]>]
   [-IncludeWindowsInstaller]
   [-IncludeSystemComponent]
   [<CommonParameters>]
Get-Package
   [[-Name] <String[]>]
   [-RequiredVersion <String>]
   [-MinimumVersion <String>]
   [-MaximumVersion <String>]
   [-AllVersions]
   [-Force]
   [-ForceBootstrap]
   [-ProviderName <String[]>]
   [-AdditionalArguments <String[]>]
   [<CommonParameters>]
Get-Package
   [[-Name] <String[]>]
   [-RequiredVersion <String>]
   [-MinimumVersion <String>]
   [-MaximumVersion <String>]
   [-AllVersions]
   [-Force]
   [-ForceBootstrap]
   [-ProviderName <String[]>]
   [-Destination <String>]
   [-ExcludeVersion]
   [-Scope <String>]
   [<CommonParameters>]
Get-Package
   [[-Name] <String[]>]
   [-RequiredVersion <String>]
   [-MinimumVersion <String>]
   [-MaximumVersion <String>]
   [-AllVersions]
   [-Force]
   [-ForceBootstrap]
   [-ProviderName <String[]>]
   [-Scope <String>]
   [-PackageManagementProvider <String>]
   [-Type <String>]
   [-AllowClobber]
   [-SkipPublisherCheck]
   [-InstallUpdate]
   [-NoPathUpdate]
   [<CommonParameters>]

Description

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.

Examples

Example 1: Get all installed packages

PS C:\> Get-Package

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

Example 2: Get packages that are installed on a remote computer

PS C:\> Invoke-Command -ComputerName "server01" -Credential "CONTOSO\TestUser" -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 CONTOSO\TestUser.

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

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

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

Optional Parameters

-AdditionalArguments

Specifies additional arguments.

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

Indicates that Get-Package returns all available versions of the package. By default, Get-Package only returns 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
-Destination

{{Fill Destination Description}}

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

Forces the command to run without asking for user confirmation.

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

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

Type: SwitchParameter
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
-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 add this parameter, Get-Package finds the highest 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, Find-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
-Name

Specifies one or more package names, or package names with wildcard characters. Separate multiple package names with commas.

Type: String[]
Position: 1
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. Separate multiple package provider names with commas.

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

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.

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

Specifies the search scope for the package.

Type: String
Parameter Sets: CurrentUser, AllUsers
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
-Type

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

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

Outputs

SoftwareIdentity[]