Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add filter-by install scope (user/machine) for List and Search#6044

Open
IDisposable wants to merge 1 commit intomicrosoft:master from
IDisposable:feature/more-filters
Open

Add filter-by install scope (user/machine) for List and Search #6044
IDisposable wants to merge 1 commit intomicrosoft:master from
IDisposable:feature/more-filters

Conversation

@IDisposable
Copy link

@IDisposable IDisposable commented Feb 12, 2026
edited
Loading

Fixes #6045 and Implements #4236 (summarized in #1155), #6046, and #6047

Microsoft Reviewers: Open in CodeFlow

This comment has been minimized.

This comment has been minimized.

Also fix the filter-by source for List to work.
Added parameter to Get-WinGetPackage for install scope and
pass it down to the filters sent to WinGet CLI.
Copy link
Author

Unrecognized words (1)

pagckages

Oops, fixed and force-pushed

Copy link
Member

@JohnMcPMS JohnMcPMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no actual change to behavior presented here (save potential improvements to completion). Filtering by scope is already present on list and adding it to search will require significant investment, including placing the scope into the index.

Filtering the list output based on the source parameter is achievable with a client only change, but this PR doesn't actually do what is needed.


## Bug Fixes

> 1. Prior to this version, it was permitted to provide a `--source` filter for the `winget list` command, however the parameter was ignored. Now if a filter is provided packages will be check before being returned from the `winget list` command.
Copy link
Member

@JohnMcPMS JohnMcPMS Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> 1. Prior to this version, it was permitted to provide a `--source` filter for the `winget list` command, however the parameter was ignored. Now if a filter is provided packages will be check before being returned from the `winget list` command.
> 1. Prior to this version, it was permitted to provide a `--source` filter for the `winget list` command, however the parameter was used only to limit the sources to correlate with. Now, if a filter is provided, packages will be filtered before being output from the `winget list` command.

This is false; the parameter was used inconsistently from how it would seem most people expected (but very consistently with the rest of the command workflows).

Copy link
Author

@IDisposable IDisposable Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When calling the Powershell API, it sure doesn't seem to filter by scope. My goal is to find all the user-scoped, winget-installed packages and reinstall them as machine-scoped if possible. Trying to script in Powershell...

Argument::ForType(Execution::Args::Type::Tag),
Argument::ForType(Execution::Args::Type::Command),
Argument::ForType(Execution::Args::Type::Source),
Argument{ Execution::Args::Type::InstallScope, Resource::String::InstalledScopeArgumentDescription, ArgumentType::Standard, Argument::Visibility::Help },
Copy link
Member

@JohnMcPMS JohnMcPMS Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Argument{ Execution::Args::Type::InstallScope, Resource::String::InstalledScopeArgumentDescription, ArgumentType::Standard, Argument::Visibility::Help },
Argument{ Execution::Args::Type::InstallScope, Resource::String::InstallScopeDescription, ArgumentType::Standard, Argument::Visibility::Help },

Additionally, just accepting the parameter is unlikely to have the desired effect on the downstream workflow. search in particular intentionally avoids accessing the manifest, which is currently the only way to know available scopes and thus filter the results.

Copy link
Author

@IDisposable IDisposable Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point. I was really only concerned with pulling a list to make an script to do an automated "user" to "machine" reinstall. I'll pull the search changes :)

}

Export-ModuleMember -Function Get-WinGetPackage No newline at end of file
Function Get-WinGetPackage{
Copy link
Member

@JohnMcPMS JohnMcPMS Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is not used; the PowerShell is all C# in \src\PowerShell.

Copy link
Author

@IDisposable IDisposable Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like that should be removed then? Seems really confusing.


# New Feature: Filter List and Search command by install scope

This adds the ability to filter the list returned by the `winget list` and `winget search` commands by the install scope
Copy link
Member

@JohnMcPMS JohnMcPMS Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

list already accepted scope.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Author-Feedback Issue needs attention from issue or PR author Needs-Attention Issue needs attention from Microsoft and removed Needs-Author-Feedback Issue needs attention from issue or PR author labels Feb 13, 2026
Copy link
Author

Filtering the list output based on the source parameter is achievable with a client only change, but this PR doesn't actually do what is needed.

What, beyond doing the same logic as the source is needed? https://github.com/microsoft/winget-cli/pull/6044/changes#diff-2cf6f75aa8aad569ed10c9f32e985e9348f431490438e7361d4a484c80050dceR66

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JohnMcPMS JohnMcPMS JohnMcPMS requested changes

Requested changes must be addressed to merge this pull request.

Labels

Needs-Attention Issue needs attention from Microsoft

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

The filter parameter --source for winget list is ignored.

AltStyle によって変換されたページ (->オリジナル) /