Syntax
Description
TheUninstall-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
The package object to uninstall. This parameter accepts pipeline input from
Pipeline Input: true
Parameter Set: GivenSet
Get-WinGetPackage.Aliases: InputObjectPipeline Input: true
Parameter Set: GivenSet
The package identifier to match against. Supports wildcard matching based on the MatchOption parameter.Pipeline Input: true (by property name)
Parameter Set: FoundSet
Parameter Set: FoundSet
The package name to match against. Supports wildcard matching based on the MatchOption parameter.Pipeline Input: true (by property name)
Parameter Set: FoundSet
Parameter Set: FoundSet
The package moniker to match against. Monikers are short, memorable names for packages.Pipeline Input: true (by property name)
Parameter Set: FoundSet
Parameter Set: FoundSet
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
Parameter Set: FoundSet
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
Parameter Set: FoundSet
Position: 0
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)
Controls how package fields are matched. Valid values:
Parameter Set: FoundSet
Equals- Exact match (case sensitive)EqualsCaseInsensitive- Exact match (case insensitive)StartsWithCaseInsensitive- Starts with matchContainsCaseInsensitive- Contains match
Parameter Set: FoundSet
The uninstallation mode. Valid values:
Default- Use the package’s default uninstall modeSilent- Silent uninstallation with no UIInteractive- Interactive uninstallation with UI
Path to the log file. The uninstaller’s output will be logged to this file.Pipeline Input: true (by property name)
Continue uninstallation upon non-security-related failures.Pipeline Input: true (by property name)
Shows what would happen if the cmdlet runs without actually executing it.
Prompts for confirmation before executing the uninstallation.
Outputs
The result of the uninstallation operation.
Examples
Example 1: Uninstall by ID
Example 2: Uninstall from Pipeline
Example 3: Uninstall with Force
Example 4: Uninstall Specific Version
Example 5: Uninstall with Logging
Example 6: Interactive Uninstallation
Example 7: Test Uninstallation with WhatIf
Example 8: Uninstall with Confirmation
Example 9: Uninstall Multiple Packages
Example 10: Uninstall by Name with Match Option
Notes
- Alias:
uswgp - Supports
-WhatIfand-Confirmparameters - Accepts pipeline input from
Get-WinGetPackage - Default
MatchOptionisEqualsCaseInsensitivefor single package operations - Use
-Forceto continue on non-critical errors - The cmdlet matches against installed packages only