pin command manages package pins. Pinning prevents packages from being upgraded beyond a specified version.
Subcommands
winget pin add- Add a pin to a packagewinget pin remove- Remove a pin from a packagewinget pin list- List all pinned packageswinget pin reset- Reset all pins
winget pin add
Pins a package at its current version or a specified version.Syntax
Options
Package to pin
Pin by package identifier
Pin by package name
Pin by package moniker
Filter by package tag
Filter by command name
Source where package is registered
Use exact string matching
Pin to specific version or version range (e.g., “1.2.*”)
Create blocking pin (prevents all upgrades)
Pin at currently installed version
Override existing pin
Examples
winget pin remove
Removes a pin from a package.Syntax
Options
Same filter options aspin add: --id, --name, --moniker, --source, etc.
Examples
winget pin list
Lists all pinned packages.Syntax
Options
Supports filter options to narrow results:--id, --name, --moniker, --source
Examples
Output Format
winget pin reset
Resets (removes) all pins or pins from a specific source.Syntax
Options
Required to confirm reset operation
Reset only pins from specified source
Examples
Pin Types
Blocking Pin
Prevents all upgrades of the package. Created with--blocking flag.
Gating Pin
Prevents upgrades beyond a specified version. Created with--version flag.
Version Ranges
Supports wildcard patterns:0.70.*- Allow patch updates0.*- Allow minor and patch updates*- Allow all updates (effectively no pin)
Bypassing Pins
Pins can be bypassed using the--force flag with upgrade commands:
Exit Codes
0- Success0x8A150001- Package not found0x8A15002D- Pin already exists0x8A15002E- Pin not found
Pins are stored locally and apply only to the current user’s WinGet configuration.