Skip to main content
Retrieves installed packages from the local system.

Syntax

Get-WinGetPackage
    [-Id <string>]
    [-Name <string>]
    [-Moniker <string>]
    [-Source <string>]
    [-Query <string[]>]
    [-Tag <string>]
    [-Command <string>]
    [-Count <uint>]
    [-MatchOption <PSPackageFieldMatchOption>]
    [<CommonParameters>]

Description

The Get-WinGetPackage cmdlet retrieves packages installed on the local system. You can filter packages by ID, name, moniker, tags, commands, or perform a general search across all fields using the Query parameter. Results can be piped to Update-WinGetPackage or Uninstall-WinGetPackage.

Parameters

Id
string
The package identifier to match against. Supports wildcard matching based on the MatchOption parameter.Pipeline Input: true (by property name)
Parameter Set: FoundSet
Name
string
The package name to match against. Supports wildcard matching based on the MatchOption parameter.Pipeline Input: true (by property name)
Parameter Set: FoundSet
Moniker
string
The package moniker to match against. Monikers are short, memorable names for packages.Pipeline Input: true (by property name)
Parameter Set: FoundSet
Source
string
The name of the source where the package was installed from. If not specified, searches all configured sources.Pipeline Input: true (by property name)
Parameter Set: FoundSet
Query
string[]
One or more strings that match against all fields of a package. Use for general search.Pipeline Input: true (by property name, remaining arguments)
Parameter Set: FoundSet
Position: 0
Tag
string
Filter packages by tag. Matches against the tags defined in the package manifest.Pipeline Input: true (by property name)
Parameter Set: FoundSet
Command
string
Filter packages by command. Matches against commands provided by the package.Pipeline Input: true (by property name)
Parameter Set: FoundSet
Count
uint
default:"unlimited"
The maximum number of results to return. Valid range: 1-1000.Pipeline Input: true (by property name)
Parameter Set: FoundSet
MatchOption
PSPackageFieldMatchOption
default:"ContainsCaseInsensitive"
Controls how package fields are matched. Valid values:
  • Equals - Exact match (case sensitive)
  • EqualsCaseInsensitive - Exact match (case insensitive)
  • StartsWithCaseInsensitive - Starts with match
  • ContainsCaseInsensitive - Contains match
Pipeline Input: true (by property name)
Parameter Set: FoundSet

Outputs

PSInstalledCatalogPackage
object
An installed package on the local system.

Examples

Example 1: List All Installed Packages

Get-WinGetPackage
Lists all packages installed on the system.

Example 2: Get Package by Name

Get-WinGetPackage -Name "PowerToys"
Finds installed packages with names containing “PowerToys”.

Example 3: Get Package by ID

Get-WinGetPackage -Id Microsoft.PowerToys
Gets the PowerToys package using its exact ID.

Example 4: Get Packages with Updates

Get-WinGetPackage | Where-Object { $_.IsUpdateAvailable }
Lists all packages that have available updates.

Example 5: Get Packages from Source

Get-WinGetPackage -Source winget
Lists packages installed from the winget source.
Get-WinGetPackage -Query "Microsoft"
Searches for “Microsoft” across all fields of installed packages.

Example 7: Limit Results

Get-WinGetPackage -Count 10
Returns the first 10 installed packages.

Example 8: Get and Update

Get-WinGetPackage -Id Microsoft.PowerToys | Update-WinGetPackage
Gets PowerToys and updates it via the pipeline.

Example 9: Get and Uninstall

Get-WinGetPackage -Name "OldApp" | Uninstall-WinGetPackage
Finds and uninstalls a package via the pipeline.

Example 10: Format Output

Get-WinGetPackage | Select-Object Name, InstalledVersion, IsUpdateAvailable | Format-Table
Lists installed packages with selected properties in table format.

Example 11: Export to CSV

Get-WinGetPackage | Export-Csv -Path "C:\installed-packages.csv" -NoTypeInformation
Exports the list of installed packages to a CSV file.

Example 12: Count Installed Packages

(Get-WinGetPackage).Count
Counts the total number of installed packages.

Example 13: Filter by Publisher

Get-WinGetPackage | Where-Object { $_.Publisher -eq "Microsoft Corporation" }
Filters packages by publisher.

Example 14: Update All Packages

Get-WinGetPackage | Where-Object { $_.IsUpdateAvailable } | ForEach-Object {
    Update-WinGetPackage -Id $_.Id
}
Updates all packages that have available updates.

Notes

  • Alias: gwgp
  • Default MatchOption is ContainsCaseInsensitive for search operations
  • Results can be piped to Update-WinGetPackage or Uninstall-WinGetPackage
  • Use the IsUpdateAvailable property to check for updates
  • The cmdlet queries installed packages from all configured sources

Build docs developers (and LLMs) love