winget-cli
winget-cli copied to clipboard
Update-WinGetPackage default behavior
The default behavior of the
Update-WingetPackage looks wrong. It should not try to upgrade all packages but only the ones with update available. So it should be a a syntactic sugar for Get-WinGetPackage | Where-Object -Property IsUpdateAvailable -eq $true | ForEach-Object { Update-WinGetPackage -Id $_.ID } , not Get-WinGetPackage | ForEach-Object { Update-WinGetPackage -Id $_.ID }. Currently it gets all the packages and then throws an exception.
P.S: Excuse me for the bad redaction.
Originally posted by @zbalkan in https://github.com/microsoft/winget-cli/discussions/3182#discussioncomment-5839059
I'll add to this re: "default behaviour". We should have an output that displays what has been updated (i.e. the name/id of the package in one of the columns). Currently it's like this:
IMO it's actually better behavior than the winget cli itself has, as assuming * is how other package managers behave, so the existing behavior is something of a consistency win.
But being able to use at least the common properties as params to the Update-WinGetPackage cmtlet itself would also be excellent and avoid the need to pipe it, which is clunky.
Nobody pipes apt list --upgradable to grep and feeds the output to apt install, for example.