Uninstall-WinGetPackage.md (8054B)
1 --- 2 external help file: Microsoft.WinGet.Client.Cmdlets.dll-Help.xml 3 Module Name: Microsoft.WinGet.Client 4 ms.date: 08/01/2024 5 online version: 6 schema: 2.0.0 7 title: Uninstall-WinGetPackage 8 --- 9 10 # Uninstall-WinGetPackage 11 12 ## SYNOPSIS 13 Uninstalls a WinGet Package. 14 15 ## SYNTAX 16 17 ### FoundSet (Default) 18 19 ``` 20 Uninstall-WinGetPackage [-Mode <PSPackageUninstallMode>] [-Force] [-Log <String>] [-Version <String>] 21 [-Id <String>] [-Name <String>] [-Moniker <String>] [-Source <String>] [[-Query] <String[]>] 22 [-MatchOption <PSPackageFieldMatchOption>] [-WhatIf] [-Confirm] [<CommonParameters>] 23 ``` 24 25 ### GivenSet 26 27 ``` 28 Uninstall-WinGetPackage [-Mode <PSPackageUninstallMode>] [-Force] [-Log <String>] 29 [[-PSCatalogPackage] <PSCatalogPackage>] [-Version <String>] [-WhatIf] 30 [-Confirm] [<CommonParameters>] 31 ``` 32 33 ## DESCRIPTION 34 35 This command uninstalls a WinGet package from your computer. The command includes parameters to 36 specify values used to search for installed packages. By default, all string-based searches are 37 case-insensitive substring searches. Wildcards are not supported. You can change the search behavior 38 using the **MatchOption** parameter. 39 40 ## EXAMPLES 41 42 ### Example 1: Uninstall a package using a query 43 44 ```powershell 45 Uninstall-WinGetPackage Microsoft.PowerShell 46 ``` 47 48 This example show how to uninstall a package using a query. The **Query** parameter is positional, 49 so you don't need to include the parameter name before the query string. 50 51 ### Example 2: Uninstall a package by Id 52 53 ```powershell 54 Uninstall-WinGetPackage -Id Microsoft.PowerShell 55 ``` 56 57 This example shows how to uninstall a package by the specifying the package identifier. 58 59 If the package identifier is available from more than one source, you must provide additional search 60 criteria to select a specific instance of the package. 61 62 ### Example 3: Uninstall a package by Name 63 64 ```powershell 65 Uninstall-WinGetPackage -Name "PowerToys (Preview)" 66 ``` 67 68 This sample uninstalls the PowerToys package by the specifying the package name. 69 70 ### Example 4: Uninstall a specific version of a package 71 72 ```powershell 73 Uninstall-WinGetPackage Microsoft.PowerShell -Version 7.4.4.0 74 ``` 75 76 This example shows how to uninstall a specific version of a package using a query. The command does 77 a query search for packages matching `Microsoft.PowerShell`. The results of the search a limited to 78 matches with the version of `7.4.4.0`. 79 80 ## PARAMETERS 81 82 ### -Force 83 84 Force the uninstall to run. 85 86 ```yaml 87 Type: System.Management.Automation.SwitchParameter 88 Parameter Sets: (All) 89 Aliases: 90 91 Required: False 92 Position: Named 93 Default value: None 94 Accept pipeline input: True (ByPropertyName) 95 Accept wildcard characters: False 96 ``` 97 98 ### -Id 99 100 Specify the package identifier to search for. By default, the command does a case-insensitive 101 substring match. 102 103 ```yaml 104 Type: System.String 105 Parameter Sets: FoundSet 106 Aliases: 107 108 Required: False 109 Position: Named 110 Default value: None 111 Accept pipeline input: True (ByPropertyName) 112 Accept wildcard characters: False 113 ``` 114 115 ### -Log 116 117 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`. 118 119 > **Note: Not all uninstallers support this option.** 120 121 ```yaml 122 Type: System.String 123 Parameter Sets: (All) 124 Aliases: 125 126 Required: False 127 Position: Named 128 Default value: None 129 Accept pipeline input: True (ByPropertyName) 130 Accept wildcard characters: False 131 ``` 132 133 ### -MatchOption 134 135 Specify the match option for a WinGet package query. This parameter accepts the following values: 136 137 - `Equals` 138 - `EqualsCaseInsensitive` 139 - `StartsWithCaseInsensitive` 140 - `ContainsCaseInsensitive` 141 142 ```yaml 143 Type: Microsoft.WinGet.Client.PSObjects.PSPackageFieldMatchOption 144 Parameter Sets: FoundSet 145 Aliases: 146 Accepted values: Equals, EqualsCaseInsensitive, StartsWithCaseInsensitive, ContainsCaseInsensitive 147 148 Required: False 149 Position: Named 150 Default value: None 151 Accept pipeline input: True (ByPropertyName) 152 Accept wildcard characters: False 153 ``` 154 155 ### -Mode 156 157 Specify the output mode for the installer. The parameter accepts the following values: 158 159 - `Default` 160 - `Silent` 161 - `Interactive` 162 163 > [!NOTE] 164 > Not all uninstallers support all modes. 165 166 ```yaml 167 Type: Microsoft.WinGet.Client.PSObjects.PSPackageUninstallMode 168 Parameter Sets: (All) 169 Aliases: 170 Accepted values: Default, Silent, Interactive 171 172 Required: False 173 Position: Named 174 Default value: None 175 Accept pipeline input: True (ByPropertyName) 176 Accept wildcard characters: False 177 ``` 178 179 ### -Moniker 180 181 Specify the moniker of the WinGet package to download. For example, the moniker for the 182 Microsoft.PowerShell package is `pwsh`. 183 184 ```yaml 185 Type: System.String 186 Parameter Sets: FoundSet 187 Aliases: 188 189 Required: False 190 Position: Named 191 Default value: None 192 Accept pipeline input: True (ByPropertyName) 193 Accept wildcard characters: False 194 ``` 195 196 ### -Name 197 198 Specify the name of the WinGet package name. The name contains space, you must enclose the name in 199 quotes. 200 201 ```yaml 202 Type: System.String 203 Parameter Sets: FoundSet 204 Aliases: 205 206 Required: False 207 Position: Named 208 Default value: None 209 Accept pipeline input: True (ByPropertyName) 210 Accept wildcard characters: False 211 ``` 212 213 ### -PSCatalogPackage 214 215 Provide **PSCatalogPackage** object. You can get a **PSCatalogPackage** object by using the 216 `Find-WinGetPackage` or `Get-WingetPackage` commands. 217 218 ```yaml 219 Type: Microsoft.WinGet.Client.Engine.PSObjects.PSCatalogPackage 220 Parameter Sets: GivenSet 221 Aliases: InputObject 222 223 Required: False 224 Position: 0 225 Default value: None 226 Accept pipeline input: True (ByPropertyName, ByValue) 227 Accept wildcard characters: False 228 ``` 229 230 ### -Query 231 232 Specify one or more strings to search for. By default, the command searches all configured sources. 233 Wildcards are not supported. The command compares the value provided to the following package 234 manifest properties: 235 236 - `PackageIdentifier` 237 - `PackageName` 238 - `Moniker` 239 - `Tags` 240 241 The command does a case-insensitive substring comparison of these properties. 242 243 ```yaml 244 Type: System.String[] 245 Parameter Sets: FoundSet 246 Aliases: 247 248 Required: False 249 Position: 0 250 Default value: None 251 Accept pipeline input: True (ByPropertyName) 252 Accept wildcard characters: False 253 ``` 254 255 ### -Source 256 257 Specify the name of a configured WinGet source. 258 259 ```yaml 260 Type: System.String 261 Parameter Sets: FoundSet 262 Aliases: 263 264 Required: False 265 Position: Named 266 Default value: None 267 Accept pipeline input: True (ByPropertyName) 268 Accept wildcard characters: False 269 ``` 270 271 ### -Version 272 273 Specify the version of the package to be uninstalled. 274 275 ```yaml 276 Type: System.String 277 Parameter Sets: (All) 278 Aliases: 279 280 Required: False 281 Position: Named 282 Default value: None 283 Accept pipeline input: True (ByPropertyName) 284 Accept wildcard characters: False 285 ``` 286 287 ### -Confirm 288 289 Prompts you for confirmation before running the cmdlet. 290 291 ```yaml 292 Type: System.Management.Automation.SwitchParameter 293 Parameter Sets: (All) 294 Aliases: cf 295 296 Required: False 297 Position: Named 298 Default value: None 299 Accept pipeline input: False 300 Accept wildcard characters: False 301 ``` 302 303 ### -WhatIf 304 305 Shows what would happen if the cmdlet runs. The cmdlet isn't run. 306 307 ```yaml 308 Type: System.Management.Automation.SwitchParameter 309 Parameter Sets: (All) 310 Aliases: wi 311 312 Required: False 313 Position: Named 314 Default value: None 315 Accept pipeline input: False 316 Accept wildcard characters: False 317 ``` 318 319 ### CommonParameters 320 321 This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, 322 -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, 323 -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see 324 [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 325 326 ## INPUTS 327 328 ### Microsoft.WinGet.Client.PSObjects.PSPackageUninstallMode 329 330 ### System.Management.Automation.SwitchParameter 331 332 ### System.String 333 334 ### Microsoft.WinGet.Client.Engine.PSObjects.PSCatalogPackage 335 336 ### System.String[] 337 338 ### Microsoft.WinGet.Client.PSObjects.PSPackageFieldMatchOption 339 340 ## OUTPUTS 341 342 ### Microsoft.WinGet.Client.Engine.PSObjects.PSUninstallResult 343 344 ## NOTES 345 346 ## RELATED LINKS 347 348 [Get-WinGetPackage](Get-WinGetPackage.md) 349 350 [Install-WinGetPackage](Install-WinGetPackage.md)