Skip to main content
Updates a package from the pipeline or from the local system to a newer version.

Syntax

Update-WinGetPackage
    [-PSCatalogPackage <PSCatalogPackage>]
    [-Id <string>]
    [-Name <string>]
    [-Moniker <string>]
    [-Source <string>]
    [-Query <string[]>]
    [-Version <string>]
    [-MatchOption <PSPackageFieldMatchOption>]
    [-Mode <PSPackageInstallMode>]
    [-Scope <PSPackageInstallScope>]
    [-Architecture <PSProcessorArchitecture>]
    [-InstallerType <PSPackageInstallerType>]
    [-Override <string>]
    [-Custom <string>]
    [-Location <string>]
    [-Log <string>]
    [-Header <string>]
    [-AllowHashMismatch]
    [-Force]
    [-SkipDependencies]
    [-IncludeUnknown]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Update-WinGetPackage cmdlet updates an installed package to a newer version. You can specify packages by ID, name, moniker, or by passing a package object from Get-WinGetPackage. If no version is specified, updates to the latest available version.

Parameters

PSCatalogPackage
PSCatalogPackage
The package object to update. 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 to search for package updates. 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 to update to. If not specified, updates to the latest version.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
PSPackageInstallMode
default:"Default"
The installation mode for the update. Valid values:
  • Default - Use the package’s default install mode
  • Silent - Silent installation with no UI
  • Interactive - Interactive installation with UI
Pipeline Input: true (by property name)
Scope
PSPackageInstallScope
default:"Any"
The installation scope. Valid values:
  • Any - Install to any available scope
  • User - Install for current user only
  • Machine - Install for all users (requires admin)
Pipeline Input: true (by property name)
Architecture
PSProcessorArchitecture
default:"Default"
The processor architecture to install. Valid values:
  • Default - Use default architecture
  • X86 - 32-bit x86
  • X64 - 64-bit x64
  • Arm - ARM
  • Arm64 - ARM64
Pipeline Input: true (by property name)
InstallerType
PSPackageInstallerType
default:"Default"
The installer type to use. Valid values include:
  • Default - Use package’s default installer
  • Exe - Executable installer
  • Msi - Windows Installer package
  • Msix - MSIX package
Pipeline Input: true (by property name)
Override
string
Override arguments to pass to the installer, replacing default arguments.Pipeline Input: true (by property name)
Custom
string
Additional custom arguments to pass to the installer in addition to defaults.Pipeline Input: true (by property name)
Location
string
The installation directory. Path can be relative or absolute.Pipeline Input: true (by property name)
Log
string
Path to the log file. The installer’s output will be logged to this file.Pipeline Input: true (by property name)
Header
string
Optional HTTP header to pass to REST-based sources.Pipeline Input: true (by property name)
AllowHashMismatch
switch
Skip the installer hash validation check. Use with caution.Pipeline Input: true (by property name)
Force
switch
Continue installation upon non-security-related failures.Pipeline Input: true (by property name)
SkipDependencies
switch
Skip installing package dependencies.Pipeline Input: true (by property name)
IncludeUnknown
switch
Include packages with unknown versions in the update. By default, packages with unknown versions are skipped.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 update.

Outputs

PSInstallResult
object
The result of the update operation.

Examples

Example 1: Update by ID

Update-WinGetPackage -Id Microsoft.PowerToys
Updates PowerToys to the latest version.

Example 2: Update to Specific Version

Update-WinGetPackage -Id Microsoft.PowerToys -Version 0.71.0
Updates PowerToys to a specific version.

Example 3: Update from Pipeline

Get-WinGetPackage -Id Microsoft.PowerToys | Update-WinGetPackage
Gets an installed package and updates it via the pipeline.

Example 4: Update All Packages

Get-WinGetPackage | Where-Object { $_.IsUpdateAvailable } | Update-WinGetPackage
Updates all packages that have available updates.

Example 5: Update with Logging

Update-WinGetPackage -Id Microsoft.PowerToys -Log "C:\Logs\powertoys-update.log"
Updates PowerToys and logs the output to a file.

Example 6: Update with Custom Arguments

Update-WinGetPackage -Id Microsoft.VisualStudioCode -Custom "/NORESTART"
Updates Visual Studio Code with custom installer arguments.

Example 7: Update Including Unknown Versions

Update-WinGetPackage -Id CustomApp -IncludeUnknown
Updates a package even if the current version is unknown.

Example 8: Silent Update

Update-WinGetPackage -Id Microsoft.PowerToys -Mode Silent
Updates PowerToys silently without showing UI.

Example 9: Test Update with WhatIf

Update-WinGetPackage -Id Microsoft.PowerToys -WhatIf
Shows what would happen without actually updating.

Example 10: Update with Force

Update-WinGetPackage -Id Microsoft.PowerToys -Force
Updates PowerToys, continuing on non-critical errors.

Notes

  • Alias: udwgp
  • Supports -WhatIf and -Confirm parameters
  • Accepts pipeline input from Get-WinGetPackage
  • Default MatchOption is EqualsCaseInsensitive for single package operations
  • Use -IncludeUnknown to update packages with unknown installed versions
  • The update process uses the same installer as the initial installation

Build docs developers (and LLMs) love