Relevant area(s)
WinGet CLI
Relevant command(s)
winget list
Brief description of your issue
When running winget list --upgrade-available, the return code of the command depends on whether the package is locally installed, rather than if there is an upgrade available. This makes it hard to check if a package has an upgrade avilable in scripts.
Steps to reproduce
# package installed outdated version
winget install OpenVPNTechnologies.OpenVPN --version 2.6.1402 --silent | Out-Null
winget list OpenVPNTechnologies.OpenVPN --upgrade-available | Out-Null ; $LastExitCode
# package installed latest version
winget upgrade OpenVPNTechnologies.OpenVPN --silent | Out-Null
winget list OpenVPNTechnologies.OpenVPN --upgrade-available | Out-Null ; $LastExitCode
# package not installed
winget uninstall OpenVPNTechnologies.OpenVPN | Out-Null
winget list OpenVPNTechnologies.OpenVPN --upgrade-available | Out-Null ; $LastExitCode
Expected behavior
0
Any non zero
-1978335212
Actual behavior
0
0
-1978335212
Environment
Winget v1.11.430
Windows.Desktop v10.0.26100.4946
Microsoft.DesktopAppInstaller v1.26.430.0
Relevant area(s)
WinGet CLI
Relevant command(s)
winget list
Brief description of your issue
When running
winget list --upgrade-available, the return code of the command depends on whether the package is locally installed, rather than if there is an upgrade available. This makes it hard to check if a package has an upgrade avilable in scripts.Steps to reproduce
Expected behavior
0
Any non zero
-1978335212
Actual behavior
0
0
-1978335212
Environment