Skip to main content
Uninstalls a package from the local system.

Syntax

Uninstall-WinGetPackage
    [-PSCatalogPackage <PSCatalogPackage>]
    [-Id <string>]
    [-Name <string>]
    [-Moniker <string>]
    [-Source <string>]
    [-Query <string[]>]
    [-Version <string>]
    [-MatchOption <PSPackageFieldMatchOption>]
    [-Mode <PSPackageUninstallMode>]
    [-Log <string>]
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Uninstall-WinGetPackage cmdlet removes a package from the local system. You can specify packages by ID, name, moniker, or by passing a package object from Get-WinGetPackage.

Parameters

PSCatalogPackage
PSCatalogPackage
The package object to uninstall. This parameter accepts pipeline input from Get-WinGetPackage.Aliases: InputObject
Pipeline Input: true
Parameter Set: GivenSet
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
Version
string
The specific version of the package to uninstall. If not specified and multiple versions exist, uninstalls the most recent.Pipeline Input: true (by property name)
MatchOption
PSPackageFieldMatchOption
default:"EqualsCaseInsensitive"
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
Mode
PSPackageUninstallMode
default:"Default"
The uninstallation mode. Valid values:
  • Default - Use the package’s default uninstall mode
  • Silent - Silent uninstallation with no UI
  • Interactive - Interactive uninstallation with UI
Pipeline Input: true (by property name)
Log
string
Path to the log file. The uninstaller’s output will be logged to this file.Pipeline Input: true (by property name)
Force
switch
Continue uninstallation upon non-security-related failures.Pipeline Input: true (by property name)
WhatIf
switch
Shows what would happen if the cmdlet runs without actually executing it.
Confirm
switch
Prompts for confirmation before executing the uninstallation.

Outputs

PSUninstallResult
object
The result of the uninstallation operation.

Examples

Example 1: Uninstall by ID

Uninstall-WinGetPackage -Id Microsoft.PowerToys
Uninstalls PowerToys using the package ID.

Example 2: Uninstall from Pipeline

Get-WinGetPackage -Name "PowerToys" | Uninstall-WinGetPackage
Finds an installed package and uninstalls it via the pipeline.

Example 3: Uninstall with Force

Uninstall-WinGetPackage -Id Microsoft.PowerToys -Force
Uninstalls PowerToys, continuing on non-critical errors.

Example 4: Uninstall Specific Version

Uninstall-WinGetPackage -Id Microsoft.PowerToys -Version 0.70.0
Uninstalls a specific version of PowerToys.

Example 5: Uninstall with Logging

Uninstall-WinGetPackage -Id Microsoft.PowerToys -Log "C:\Logs\powertoys-uninstall.log"
Uninstalls PowerToys and logs the output to a file.

Example 6: Interactive Uninstallation

Uninstall-WinGetPackage -Id Microsoft.Office -Mode Interactive
Uninstalls Office with the interactive uninstaller UI.

Example 7: Test Uninstallation with WhatIf

Uninstall-WinGetPackage -Id Microsoft.PowerToys -WhatIf
Shows what would happen without actually uninstalling.

Example 8: Uninstall with Confirmation

Uninstall-WinGetPackage -Id Microsoft.PowerToys -Confirm
Prompts for confirmation before uninstalling.

Example 9: Uninstall Multiple Packages

$packages = @("Microsoft.PowerToys", "Microsoft.VisualStudioCode")
$packages | ForEach-Object { Uninstall-WinGetPackage -Id $_ }
Uninstalls multiple packages in sequence.

Example 10: Uninstall by Name with Match Option

Uninstall-WinGetPackage -Name "Power" -MatchOption StartsWithCaseInsensitive
Uninstalls packages whose name starts with “Power”.

Notes

  • Alias: uswgp
  • Supports -WhatIf and -Confirm parameters
  • Accepts pipeline input from Get-WinGetPackage
  • Default MatchOption is EqualsCaseInsensitive for single package operations
  • Use -Force to continue on non-critical errors
  • The cmdlet matches against installed packages only

Build docs developers (and LLMs) love