microsoft / microsoft/winget-cli

`winget list --upgrade-available --include-unknown` shows pinned package as available when it should not

Open
#5,878 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Command-List Issue-Bug
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

Relevant area(s)

WinGet CLI

Relevant command(s)

winget list

Brief description of your issue

I have a pinned a package since some time ago, and I recently got an "update". However, the update should not be shown as the package was pinned, so I tried to pin it again, but it's already pinned but not possible to remove from normal list.

Steps to reproduce
#--------------------------------------------------
# winget list --upgrade-available --include-unknown
#--------------------------------------------------

Name             Id             Version Available Source
--------------------------------------------------------
Core Temp 1.18.1 ALCPU.CoreTemp 1.18.1  1.19.5    winget
1 upgrades available.
2 package(s) have pins that prevent upgrade. Use the 'winget pin' command to view and edit pins. Using the --include-pinned argument may show more results.


#--------------------------------------------------
# winget list --upgrade-available --include-unknown --include-pinned
#--------------------------------------------------

Name                   Id              Version Available Source
---------------------------------------------------------------
Core Temp 1.18.1       ALCPU.CoreTemp  1.18.1  1.19.5    winget
Postman x86_64 11.53.3 Postman.Postman 11.53.3 11.69.6   winget
3 upgrades available.

The following packages have an upgrade available, but require explicit targeting for upgrade:
Name  Id          Version  Available Source
-------------------------------------------
MSYS2 MSYS2.MSYS2 20240507 20250830  winget


#--------------------------------------------------
# winget list --upgrade-available --pinned
#--------------------------------------------------

Name                   Id              Version Available Source
---------------------------------------------------------------
Core Temp 1.18.1       ALCPU.CoreTemp  1.18.1  1.19.5    winget
Postman x86_64 11.53.3 Postman.Postman 11.53.3 11.69.6   winget
3 upgrades available.

The following packages have an upgrade available, but require explicit targeting for upgrade:
Name  Id          Version  Available Source
-------------------------------------------
MSYS2 MSYS2.MSYS2 20240507 20250830  winget
[11:36:02] emix@LAPTOP-96RIMVAL C:\mydev\wsl

#--------------------------------------------------
# winget list --upgrade-available --include-pinned
#--------------------------------------------------

Name                   Id              Version Available Source
---------------------------------------------------------------
Core Temp 1.18.1       ALCPU.CoreTemp  1.18.1  1.19.5    winget
Postman x86_64 11.53.3 Postman.Postman 11.53.3 11.69.6   winget
3 upgrades available.

The following packages have an upgrade available, but require explicit targeting for upgrade:
Name  Id          Version  Available Source
-------------------------------------------
MSYS2 MSYS2.MSYS2 20240507 20250830  winget




Expected behavior

That winget list --upgrade-available --include-unknown does not show/list pinned packages.

Actual behavior

Shows pinned packages when it shouldn't.

Environment
Windows Package Manager v1.12.350
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.26100.6899
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.27.350.0

Winget Directories
-------------------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages
Installer Downloads                %USERPROFILE%\Downloads
Configuration Modules              %LOCALAPPDATA%\Microsoft\WinGet\Configuration\Modules

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled
ProxyCommandLineOptions                   Disabled
DefaultProxy                              Disabled

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported winget list commands and tracing the WinGet CLI implementation for upgrade filtering and pinned packages. Verify that the default --upgrade-available --include-unknown output excludes pinned packages while --include-pinned and --pinned retain their documented behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, powershell
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.