microsoft / microsoft/winget-cli
Powershell Module Should Support Scope Parameter
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 26.4k
- Forks
- 1.8k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 15
Description
Description of the new feature / enhancement
Currently the winget-cli module supports a --scope parameter which can be set to user or machine.
https://learn.microsoft.com/en-us/windows/package-manager/winget/install#options
The current powershell implementation (Microsoft.Winget.Client) does not appear to support the scope parameter. Looking through the README doesn't speak to this one way or another, but looking at https://github.com/microsoft/winget-cli/blob/master/src/PowerShell/Microsoft.WinGet.Client.Engine/Commands/FinderPackageCommand.cs it appears the parameter is not currently supported.
Adding a scope parameter to the Powershell implementation would provide a powershell native way to manage machine level packages. This would be particularly useful when working with Intune, which currently only executes Powershell remotely and has no good way to execute winget as an administrator at the user scope.
Proposed technical implementation details
Implement a new scope parameter that supports the "Machine" and "User" values to bring parity with the current winget cli tool.
EX: Get-WinGetPackage -Scope "Machine"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with PowerShell command handling in src/PowerShell/Microsoft.WinGet.Client.Engine/Commands/FinderPackageCommand.cs and compare the README's documented parameters with the winget CLI scope options. Trace how Get-WinGetPackage parameters are exposed, then verify that User and Machine values are accepted and passed through consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100