< Back

Get-Package

Sat Jan 18, 2020 6:23 pm

NAME Get-Package



SYNOPSIS

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





SYNTAX

Get-Package [[-Name] <String[]>] [-AdditionalArguments <String[]>] [-AllVersions] [-Force] [-ForceBootstrap]

[-MaximumVersion <String>] [-MinimumVersion <String>] [-ProviderName {msi | NuGet | msu | Programs | PowerShellGet

| psl | chocolatey}] [-RequiredVersion <String>] [<CommonParameters>]



Get-Package [[-Name] <String[]>] [-AllVersions] [-AllowClobber] [-Force] [-ForceBootstrap] [-InstallUpdate]

[-MaximumVersion <String>] [-MinimumVersion <String>] [-NoPathUpdate] [-PackageManagementProvider <String>]

[-ProviderName {msi | NuGet | msu | Programs | PowerShellGet | psl | chocolatey}] [-RequiredVersion <String>]

[-Scope {CurrentUser | AllUsers}] [-SkipPublisherCheck] [-Type {Module | Script | All}] [<CommonParameters>]



Get-Package [[-Name] <String[]>] [-AllVersions] [-Destination <String>] [-ExcludeVersion] [-Force]

[-ForceBootstrap] [-MaximumVersion <String>] [-MinimumVersion <String>] [-ProviderName {msi | NuGet | msu |

Programs | PowerShellGet | psl | chocolatey}] [-RequiredVersion <String>] [-Scope {CurrentUser | AllUsers}]

[-SkipDependencies] [<CommonParameters>]



Get-Package [[-Name] <String[]>] [-AllVersions] [-Force] [-ForceBootstrap] [-IncludeSystemComponent]

[-IncludeWindowsInstaller] [-MaximumVersion <String>] [-MinimumVersion <String>] [-ProviderName {msi | NuGet | msu

| Programs | PowerShellGet | psl | chocolatey}] [-RequiredVersion <String>] [<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.





PARAMETERS

-AdditionalArguments <String[]>

Specifies additional arguments.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-AllVersions [<SwitchParameter>]

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

the newest available version.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-AllowClobber [<SwitchParameter>]

@{Text=}



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Destination <String>

{{Fill Destination Description}}



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ExcludeVersion [<SwitchParameter>]

{{Fill ExcludeVersion Description}}



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Force [<SwitchParameter>]

Forces the command to run without asking for user confirmation.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-ForceBootstrap [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-IncludeSystemComponent [<SwitchParameter>]

Indicates that this cmdlet includes system components in the results.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-IncludeWindowsInstaller [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-InstallUpdate [<SwitchParameter>]

Indicates that this cmdlet installs updates.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Name <String[]>

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

names with commas.



Required? false

Position? 0

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-NoPathUpdate [<SwitchParameter>]

@{Text=}



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-PackageManagementProvider <String>

Specifies the name of the Package Management provider.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ProviderName <String[]>

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



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Scope <String>

Specifies the search scope for the package.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-SkipDependencies [<SwitchParameter>]

{{Fill SkipDependencies Description}}



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-SkipPublisherCheck [<SwitchParameter>]

@{Text=}



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Type <String>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

SoftwareIdentity[]







NOTES









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.



RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkID=517135

about_PackageManagement

Find-Package

Install-Package

Save-Package

Uninstall-Package