Update-WinGetPackage.md (13993B)
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: Update-WinGetPackage 8 --- 9 10 # Update-WinGetPackage 11 12 ## SYNOPSIS 13 Installs a newer version of a previously installed WinGet package. 14 15 ## SYNTAX 16 17 ### FoundSet (Default) 18 19 ``` 20 Update-WinGetPackage [-IncludeUnknown] [-Mode <PSPackageInstallMode>] [-Override <String>] [-Custom <String>] 21 [-Location <String>] [-Log <String>] [-Force] [-Header <String>] [-AllowHashMismatch] 22 [-Architecture <PSProcessorArchitecture>] [-InstallerType <PSPackageInstallerType>] [-Locale <String>] 23 [-Scope <PSPackageInstallScope>] [-SkipDependencies] [-Version <String>] [-Id <String>] [-Name <String>] 24 [-Moniker <String>] [-Source <String>] [[-Query] <String[]>] [-MatchOption <PSPackageFieldMatchOption>] 25 [-WhatIf] [-Confirm] [<CommonParameters>] 26 ``` 27 28 ### GivenSet 29 30 ``` 31 Update-WinGetPackage [-IncludeUnknown] [-Mode <PSPackageInstallMode>] [-Override <String>] [-Custom <String>] 32 [-Location <String>] [-Log <String>] [-Force] [-Header <String>] [-AllowHashMismatch] 33 [-Architecture <PSProcessorArchitecture>] [-InstallerType <PSPackageInstallerType>] [-Locale <String>] 34 [-Scope <PSPackageInstallScope>] [-SkipDependencies] [[-PSCatalogPackage] <PSCatalogPackage>] 35 [-Version <String>] [-WhatIf] [-Confirm] [<CommonParameters>] 36 ``` 37 38 ## DESCRIPTION 39 40 This command searches the packages installed on your system and installs a newer version of the 41 matching WinGet package. The command includes parameters to specify values used to search for 42 packages in the configured sources. By default, the command searches all sources. 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. 43 44 ## EXAMPLES 45 46 ### Example 1: Update a package using a query 47 48 ```powershell 49 Update-WinGetPackage Microsoft.PowerShell 50 ``` 51 52 This example show how to update a package using a query. The **Query** parameter is positional, so 53 you don't need to include the parameter name before the query string. 54 55 ### Example 2: Update a package by Id 56 57 ```powershell 58 Update-WinGetPackage -Id Microsoft.PowerShell 59 ``` 60 61 This example shows how to update a package by the specifying the package identifier. 62 63 If the package identifier is available from more than one source, you must provide additional search 64 criteria to select a specific instance of the package. 65 66 ### Example 3: Update a package by Name 67 68 ```powershell 69 Update-WinGetPackage -Name "PowerToys (Preview)" 70 ``` 71 72 This sample updates the PowerToys package by the specifying the package name. 73 74 ### Example 4: Update to a specific version of a package 75 76 ```powershell 77 Update-WinGetPackage Microsoft.PowerShell -Version 7.4.4.0 78 ``` 79 80 This example shows how to update a specific version of a package using a query. The command does a 81 query search for packages matching `Microsoft.PowerShell`. The results of the search a limited to 82 matches with the version of `7.4.4.0`. 83 84 ### Example 5: Update all packages 85 86 ```powershell 87 Get-WinGetPackage | Where-Object IsUpdateAvailable | Update-WinGetPackage 88 ``` 89 90 This example shows how to update all packages that have an available upgrade from one of the configured sources. 91 92 ## PARAMETERS 93 94 ### -AllowHashMismatch 95 96 Allows you to download package even when the SHA256 hash for an installer or a dependency does not 97 match the SHA256 hash in the WinGet package manifest. 98 99 ```yaml 100 Type: System.Management.Automation.SwitchParameter 101 Parameter Sets: (All) 102 Aliases: 103 104 Required: False 105 Position: Named 106 Default value: None 107 Accept pipeline input: True (ByPropertyName) 108 Accept wildcard characters: False 109 ``` 110 111 ### -Architecture 112 113 Specify the processor architecture for the WinGet package installer. The parameter accepts the 114 following values: 115 116 - `Default` 117 - `X86` 118 - `Arm` 119 - `X64` 120 - `Arm64` 121 122 ```yaml 123 Type: Microsoft.WinGet.Client.PSObjects.PSProcessorArchitecture 124 Parameter Sets: (All) 125 Aliases: 126 Accepted values: Default, X86, Arm, X64, Arm64 127 128 Required: False 129 Position: Named 130 Default value: None 131 Accept pipeline input: True (ByPropertyName) 132 Accept wildcard characters: False 133 ``` 134 135 ### -Custom 136 137 Use this parameter to pass additional arguments to the installer. The parameter takes a single string value. To add multiple arguments, include the arguments in the string. The arguments must be provided in the format expected by the installer. If the string contains spaces, it must be enclosed in quotes. This string is added to the arguments defined in the package manifest. 138 139 ```yaml 140 Type: System.String 141 Parameter Sets: (All) 142 Aliases: 143 144 Required: False 145 Position: Named 146 Default value: None 147 Accept pipeline input: True (ByPropertyName) 148 Accept wildcard characters: False 149 ``` 150 151 ### -Force 152 153 Force the update to run the installer. 154 155 ```yaml 156 Type: System.Management.Automation.SwitchParameter 157 Parameter Sets: (All) 158 Aliases: 159 160 Required: False 161 Position: Named 162 Default value: None 163 Accept pipeline input: True (ByPropertyName) 164 Accept wildcard characters: False 165 ``` 166 167 ### -Header 168 169 Specify a custom value in the HTTP header to the REST source. 170 171 ```yaml 172 Type: System.String 173 Parameter Sets: (All) 174 Aliases: 175 176 Required: False 177 Position: Named 178 Default value: None 179 Accept pipeline input: True (ByPropertyName) 180 Accept wildcard characters: False 181 ``` 182 183 ### -Id 184 185 Specify the package identifier to search for. By default, the command does a case-insensitive 186 substring match. 187 188 ```yaml 189 Type: System.String 190 Parameter Sets: FoundSet 191 Aliases: 192 193 Required: False 194 Position: Named 195 Default value: None 196 Accept pipeline input: True (ByPropertyName) 197 Accept wildcard characters: False 198 ``` 199 200 ### -IncludeUnknown 201 202 Use this parameter to upgrade the package when the installed version is not specified in the 203 registry. 204 205 ```yaml 206 Type: System.Management.Automation.SwitchParameter 207 Parameter Sets: (All) 208 Aliases: 209 210 Required: False 211 Position: Named 212 Default value: None 213 Accept pipeline input: True (ByPropertyName) 214 Accept wildcard characters: False 215 ``` 216 217 ### -InstallerType 218 219 A package may contain multiple installer types. Use this parameter to select the installer you want 220 to use. The parameter accepts the following values: 221 222 - `Default` 223 - `Inno` 224 - `Wix` 225 - `Msi` 226 - `Nullsoft` 227 - `Zip` 228 - `Msix` 229 - `Exe` 230 - `Burn` 231 - `MSStore` 232 - `Portable` 233 234 ```yaml 235 Type: Microsoft.WinGet.Client.PSObjects.PSPackageInstallerType 236 Parameter Sets: (All) 237 Aliases: 238 Accepted values: Default, Inno, Wix, Msi, Nullsoft, Zip, Msix, Exe, Burn, MSStore, Portable 239 240 Required: False 241 Position: Named 242 Default value: None 243 Accept pipeline input: True (ByPropertyName) 244 Accept wildcard characters: False 245 ``` 246 247 ### -Locale 248 249 Specify the locale of the installer package. The locale must provided in the BCP 47 format, such as 250 `en-US`. For more information, see 251 [Standard locale names](/globalization/locale/standard-locale-names). 252 253 ```yaml 254 Type: System.String 255 Parameter Sets: (All) 256 Aliases: 257 258 Required: False 259 Position: Named 260 Default value: None 261 Accept pipeline input: True (ByPropertyName) 262 Accept wildcard characters: False 263 ``` 264 265 ### -Location 266 267 Specify the file path where you want the packed to be installed. The installer must be able to 268 support alternate install locations. 269 270 ```yaml 271 Type: System.String 272 Parameter Sets: (All) 273 Aliases: 274 275 Required: False 276 Position: Named 277 Default value: None 278 Accept pipeline input: True (ByPropertyName) 279 Accept wildcard characters: False 280 ``` 281 282 ### -Log 283 284 Specify the location for the installer log. The value can be a fully-qualified or relative path and must include the file name. For example: `$env:TEMP\package.log`. 285 286 > **Note: Not all installers support this property.** 287 288 ```yaml 289 Type: System.String 290 Parameter Sets: (All) 291 Aliases: 292 293 Required: False 294 Position: Named 295 Default value: None 296 Accept pipeline input: True (ByPropertyName) 297 Accept wildcard characters: False 298 ``` 299 300 ### -MatchOption 301 302 Specify the match option for a WinGet package query. This parameter accepts the following values: 303 304 - `Equals` 305 - `EqualsCaseInsensitive` 306 - `StartsWithCaseInsensitive` 307 - `ContainsCaseInsensitive` 308 309 ```yaml 310 Type: Microsoft.WinGet.Client.PSObjects.PSPackageFieldMatchOption 311 Parameter Sets: FoundSet 312 Aliases: 313 Accepted values: Equals, EqualsCaseInsensitive, StartsWithCaseInsensitive, ContainsCaseInsensitive 314 315 Required: False 316 Position: Named 317 Default value: None 318 Accept pipeline input: True (ByPropertyName) 319 Accept wildcard characters: False 320 ``` 321 322 ### -Mode 323 324 Specify the output mode for the installer. The parameter accepts the following values: 325 326 - `Default` 327 - `Silent` 328 - `Interactive` 329 330 Not all installers support all modes. 331 332 ```yaml 333 Type: Microsoft.WinGet.Client.PSObjects.PSPackageInstallMode 334 Parameter Sets: (All) 335 Aliases: 336 Accepted values: Default, Silent, Interactive 337 338 Required: False 339 Position: Named 340 Default value: None 341 Accept pipeline input: True (ByPropertyName) 342 Accept wildcard characters: False 343 ``` 344 345 ### -Moniker 346 347 Specify the moniker of the WinGet package to update. For example, the moniker for the 348 Microsoft.PowerShell package is `pwsh`. 349 350 ```yaml 351 Type: System.String 352 Parameter Sets: FoundSet 353 Aliases: 354 355 Required: False 356 Position: Named 357 Default value: None 358 Accept pipeline input: True (ByPropertyName) 359 Accept wildcard characters: False 360 ``` 361 362 ### -Name 363 364 Specify the name of the package to be updated. 365 366 ```yaml 367 Type: System.String 368 Parameter Sets: FoundSet 369 Aliases: 370 371 Required: False 372 Position: Named 373 Default value: None 374 Accept pipeline input: True (ByPropertyName) 375 Accept wildcard characters: False 376 ``` 377 378 ### -Override 379 380 Use this parameter to override the existing arguments passed to the installer. The parameter takes a single string value. To add multiple arguments, include the arguments in the string. The arguments must be provided in the format expected by the installer. If the string contains spaces, it must be enclosed in quotes. This string overrides the arguments specified in the package manifest. 381 382 ```yaml 383 Type: System.String 384 Parameter Sets: (All) 385 Aliases: 386 387 Required: False 388 Position: Named 389 Default value: None 390 Accept pipeline input: True (ByPropertyName) 391 Accept wildcard characters: False 392 ``` 393 394 ### -PSCatalogPackage 395 396 Provide **PSCatalogPackage** object. You can get a **PSCatalogPackage** object by using the 397 `Find-WinGetPackage` or `Get-WinGetPackage` commands. 398 399 ```yaml 400 Type: Microsoft.WinGet.Client.Engine.PSObjects.PSCatalogPackage 401 Parameter Sets: GivenSet 402 Aliases: InputObject 403 404 Required: False 405 Position: 0 406 Default value: None 407 Accept pipeline input: True (ByPropertyName, ByValue) 408 Accept wildcard characters: False 409 ``` 410 411 ### -Query 412 413 Specify one or more strings to search for. By default, the command searches all configured sources. 414 Wildcards are not supported. The command compares the value provided to the following package 415 manifest properties: 416 417 - `PackageIdentifier` 418 - `PackageName` 419 - `Moniker` 420 - `Tags` 421 422 The command does a case-insensitive substring comparison of these properties. 423 424 ```yaml 425 Type: System.String[] 426 Parameter Sets: FoundSet 427 Aliases: 428 429 Required: False 430 Position: 0 431 Default value: None 432 Accept pipeline input: True (ByPropertyName) 433 Accept wildcard characters: False 434 ``` 435 436 ### -Scope 437 438 Specify WinGet package installer scope. The parameter accepts the following values: 439 440 - `Any` 441 - `User` 442 - `System` 443 - `UserOrUnknown` 444 - `SystemOrUnknown` 445 446 > [!NOTE] 447 > The installer scope must be available in the WinGet package manifest. 448 449 ```yaml 450 Type: Microsoft.WinGet.Client.PSObjects.PSPackageInstallScope 451 Parameter Sets: (All) 452 Aliases: 453 Accepted values: Any, User, System, UserOrUnknown, SystemOrUnknown 454 455 Required: False 456 Position: Named 457 Default value: None 458 Accept pipeline input: True (ByPropertyName) 459 Accept wildcard characters: False 460 ``` 461 462 ### -SkipDependencies 463 464 Specifies that the command shouldn't install the WinGet package dependencies. 465 466 ```yaml 467 Type: System.Management.Automation.SwitchParameter 468 Parameter Sets: (All) 469 Aliases: 470 471 Required: False 472 Position: Named 473 Default value: None 474 Accept pipeline input: True (ByPropertyName) 475 Accept wildcard characters: False 476 ``` 477 478 ### -Source 479 480 Specify the name of a configured WinGet source. 481 482 ```yaml 483 Type: System.String 484 Parameter Sets: FoundSet 485 Aliases: 486 487 Required: False 488 Position: Named 489 Default value: None 490 Accept pipeline input: True (ByPropertyName) 491 Accept wildcard characters: False 492 ``` 493 494 ### -Version 495 496 Specify package version. 497 498 ```yaml 499 Type: System.String 500 Parameter Sets: (All) 501 Aliases: 502 503 Required: False 504 Position: Named 505 Default value: None 506 Accept pipeline input: True (ByPropertyName) 507 Accept wildcard characters: False 508 ``` 509 510 ### -Confirm 511 512 Prompts you for confirmation before running the cmdlet. 513 514 ```yaml 515 Type: System.Management.Automation.SwitchParameter 516 Parameter Sets: (All) 517 Aliases: cf 518 519 Required: False 520 Position: Named 521 Default value: None 522 Accept pipeline input: False 523 Accept wildcard characters: False 524 ``` 525 526 ### -WhatIf 527 528 Shows what would happen if the cmdlet runs. The cmdlet isn't run. 529 530 ```yaml 531 Type: System.Management.Automation.SwitchParameter 532 Parameter Sets: (All) 533 Aliases: wi 534 535 Required: False 536 Position: Named 537 Default value: None 538 Accept pipeline input: False 539 Accept wildcard characters: False 540 ``` 541 542 ### CommonParameters 543 544 This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, 545 -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, 546 -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see 547 [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 548 549 ## INPUTS 550 551 ### System.Management.Automation.SwitchParameter 552 553 ### Microsoft.WinGet.Client.PSObjects.PSPackageInstallMode 554 555 ### System.String 556 557 ### Microsoft.WinGet.Client.PSObjects.PSProcessorArchitecture 558 559 ### Microsoft.WinGet.Client.PSObjects.PSPackageInstallerType 560 561 ### Microsoft.WinGet.Client.PSObjects.PSPackageInstallScope 562 563 ### Microsoft.WinGet.Client.Engine.PSObjects.PSCatalogPackage 564 565 ### System.String[] 566 567 ### Microsoft.WinGet.Client.PSObjects.PSPackageFieldMatchOption 568 569 ## OUTPUTS 570 571 ### Microsoft.WinGet.Client.Engine.PSObjects.PSInstallResult 572 573 ## NOTES 574 575 ## RELATED LINKS 576 577 [Get-WinGetPackage](Get-WinGetPackage.md) 578 579 [Uninstall-WinGetPackage](Uninstall-WinGetPackage.md)