Bring Pinning to PowerShell Cmdlets#6190
Open
Trenly wants to merge 8 commits intomicrosoft:masterfrom
Open
Conversation
Collaborator
|
Were you able to figure out the PlatyPS MAML stuff for the PowerShell help? |
Contributor
Author
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR extends the WinGet pinning system with new metadata, a new CLI subcommand, expanded COM API surface, and PowerShell cmdlets for managing pins.
CLI Changes
winget pin add: Added--noteargument to attach an optional freeform note to a pin. The timestamp when a pin is created is now recorded automatically.winget pin show: New subcommand that displays detailed information about pins for a specific package (query by ID, name, or keyword).Pinning Index Schema (v1.1)
DateAddedandNotecolumns to the pin table to persist the new metadata.COM API (
Microsoft.Management.Deployment, contract v30)PackageManager.GetAllPins()— retrieve all pins across all sources.PackageManager.GetPins(CatalogPackage)— retrieve pins for a specific package.PackageManager.PinPackage(CatalogPackage, PinPackageOptions)— add or update a pin.PackageManager.UnpinPackage(CatalogPackage)— remove all pins for a package.PackageManager.ResetAllPins(String sourceName)— reset all pins, optionally scoped to a source.PackagePinruntime class exposingPackageId,SourceId,Type,GatedVersion,DateAdded,Note, andIsForInstalledPackage.PinPackageOptionsandPinPackageResultruntime classes.PackagePinTypeenum (PinnedByManifest,Pinning,Gating,Blocking).PowerShell (
Microsoft.WinGet.Client)Add-WinGetPin— pin a package with a specified pin type, optional gated version, note, and force flag.Get-WinGetPin— list pins, filterable by package/source.Remove-WinGetPin— remove pins for a package.Reset-WinGetPin— reset all pins, optionally scoped to a source.Get-WinGetPackage— newIsPinnedproperty on returned objects.cc @denelon for Naming
Microsoft Reviewers: Open in CodeFlow