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
22.55k stars 1.4k forks source link

Unable to list only upgradable packages with Get-WinGetPackage #4394

Closed mike406 closed 2 months ago

mike406 commented 2 months ago

Description of the new feature / enhancement

With winget cli you are able to view which packages have available upgrades by running winget list --upgrade-available. I have not been able to figure out the equivalent command when using the Microsoft.WinGet.Client Powershell module. Intuition told me that Get-WinGetPackage should be able to do this but I have not found a way. If one exists, let me know otherwise please consider adding this functionality. Thank you.

Proposed technical implementation details

Perhaps something like Get-WinGetPackage -UpgradeAvailable

mike406 commented 2 months ago

I have found it after looking closer at the properties, you can do it like this:

Get-WinGetPackage | Where IsUpdateAvailable