microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
23.38k stars 1.46k forks source link

winget list --upgrade-available cannot be sorted and PowerShell module does not support listing upgrades #4773

Closed alimbada closed 3 months ago

alimbada commented 3 months ago

winget list --upgrade-available cannot be piped to sort so via a StackOverflow answer and a couple of other issues on this repo (here and here) I found myself installing the Powershell module.

However, the module does not seem to have a way of listing available upgrades. Get-WinGetPackage has -Query and -MatchOption options (shown when tabbing for autocompletion) which do not seem to be in the current source code (maybe they're inherited?). However, these options seem to only match on strings.

I attempted to do Get-WinGetPackage | where { -not ([string]::IsNullOrWhitespace($_.AvailableVersions)) } but I get 95 results (there are quite a few results where the Available field is empty yet the package still makes it through the filter) whereas winget list --upgrade-available lists 46 upgrades.

If there is another way to list available upgrades it's not obvious and should be better documented.

Environment

Windows Package Manager v1.8.1911
Windows: Windows.Desktop v10.0.19045.4780
Package: Microsoft.DesktopAppInstaller v1.23.1911.0
github-actions[bot] commented 3 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

alimbada commented 3 months ago

The bot has indirectly answered my question but I'm not closing this as it needs better documentation.