microsoft / microsoft/winget-cli

Powershell Module Should Support Scope Parameter

Open
#4,787 10 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Feature PowerShell
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.