src/PowerShell/Help/Microsoft.WinGet.Client/Uninstall-WinGetPackage.md
Uninstalls a WinGet Package.
Uninstall-WinGetPackage [-Mode <PSPackageUninstallMode>] [-Force] [-Log <String>] [-Version <String>]
[-Id <String>] [-Name <String>] [-Moniker <String>] [-Source <String>] [[-Query] <String[]>]
[-MatchOption <PSPackageFieldMatchOption>] [-WhatIf] [-Confirm] [<CommonParameters>]
Uninstall-WinGetPackage [-Mode <PSPackageUninstallMode>] [-Force] [-Log <String>]
[[-PSCatalogPackage] <PSCatalogPackage>] [-Version <String>] [-WhatIf]
[-Confirm] [<CommonParameters>]
This command uninstalls a WinGet package from your computer. The command includes parameters to specify values used to search for installed packages. By default, all string-based searches are case-insensitive substring searches. Wildcards are not supported. You can change the search behavior using the MatchOption parameter.
Uninstall-WinGetPackage Microsoft.PowerShell
This example show how to uninstall a package using a query. The Query parameter is positional, so you don't need to include the parameter name before the query string.
Uninstall-WinGetPackage -Id Microsoft.PowerShell
This example shows how to uninstall a package by the specifying the package identifier.
If the package identifier is available from more than one source, you must provide additional search criteria to select a specific instance of the package.
Uninstall-WinGetPackage -Name "PowerToys (Preview)"
This sample uninstalls the PowerToys package by the specifying the package name.
Uninstall-WinGetPackage Microsoft.PowerShell -Version 7.4.4.0
This example shows how to uninstall a specific version of a package using a query. The command does
a query search for packages matching Microsoft.PowerShell. The results of the search a limited to
matches with the version of 7.4.4.0.
Force the uninstall to run.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specify the package identifier to search for. By default, the command does a case-insensitive substring match.
Type: System.String
Parameter Sets: FoundSet
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specify the location for the uninstaller log. The value can be a fully-qualified or relative path and must include the file name. For example: $env:TEMP\package.log.
Note: Not all uninstallers support this option.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specify the match option for a WinGet package query. This parameter accepts the following values:
EqualsEqualsCaseInsensitiveStartsWithCaseInsensitiveContainsCaseInsensitiveType: Microsoft.WinGet.Client.PSObjects.PSPackageFieldMatchOption
Parameter Sets: FoundSet
Aliases:
Accepted values: Equals, EqualsCaseInsensitive, StartsWithCaseInsensitive, ContainsCaseInsensitive
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specify the output mode for the installer. The parameter accepts the following values:
DefaultSilentInteractive[!NOTE] Not all uninstallers support all modes.
Type: Microsoft.WinGet.Client.PSObjects.PSPackageUninstallMode
Parameter Sets: (All)
Aliases:
Accepted values: Default, Silent, Interactive
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specify the moniker of the WinGet package to download. For example, the moniker for the
Microsoft.PowerShell package is pwsh.
Type: System.String
Parameter Sets: FoundSet
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specify the name of the WinGet package name. The name contains space, you must enclose the name in quotes.
Type: System.String
Parameter Sets: FoundSet
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Provide PSCatalogPackage object. You can get a PSCatalogPackage object by using the
Find-WinGetPackage or Get-WingetPackage commands.
Type: Microsoft.WinGet.Client.Engine.PSObjects.PSCatalogPackage
Parameter Sets: GivenSet
Aliases: InputObject
Required: False
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
Specify one or more strings to search for. By default, the command searches all configured sources. Wildcards are not supported. The command compares the value provided to the following package manifest properties:
- `PackageIdentifier`
- `PackageName`
- `Moniker`
- `Tags`
The command does a case-insensitive substring comparison of these properties.
Type: System.String[]
Parameter Sets: FoundSet
Aliases:
Required: False
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specify the name of a configured WinGet source.
Type: System.String
Parameter Sets: FoundSet
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specify the version of the package to be uninstalled.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Prompts you for confirmation before running the cmdlet.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Shows what would happen if the cmdlet runs. The cmdlet isn't run.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.