WinGet.exe upgrade --all -Exclude

Vij 306 Reputation points
2023-04-07T17:32:54.1133333+00:00

How to exclude the list of apps [third-party application, MS applications, and MS KBnumbers] while running winget upgrade -all commands. Is there any parameter to exclude any application? It will be appriciated

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,718 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,553 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
5,202 questions
{count} votes

Accepted answer
  1. Rich Matheisen 46,811 Reputation points
    2023-04-08T19:56:56.1566667+00:00

    There is no "-Exclude" option for the current version of WinGet.

    You can place a feature request (use the "New Issue" button) here: https://github.com/microsoft/winget-cli/issues. You'll have to create a GitHub account in order to do so.

    You can also create you own JSON file containing only the package Id's you want to update. https://learn.microsoft.com/en-us/windows/package-manager/


3 additional answers

Sort by: Most helpful
  1. Michal Mikláš 5 Reputation points
    2024-10-23T05:53:06.7033333+00:00

    There is native way to exclude apps:

    Putting the "native" cli implementation here for reference;

    Run once:

    winget pin add --id Microsoft.Teams
    winget pin add --id Microsoft.Office 
    

    After running the above, then winget upgrade --all will upgrade everything except Teams and Office

    1 person found this answer helpful.

  2. Amal Chandrappan 0 Reputation points
    2024-05-26T00:44:10.2333333+00:00

    You can do this: winget upgrade app1.id, app2.id, app3.id

    You will get the app id from the available updates list after running winget upgrade

    0 comments No comments

  3. Vij 306 Reputation points
    2024-09-18T05:45:56.2033333+00:00

    https://github.com/microsoft/winget-pkgs/discussions/124620

    Get-WinGetPackage | Where-Object {($.IsUpdateAvailable -eq $true) -and ($.Id -ne 'Microsoft.Teams') -and ($.Id -ne 'Microsoft.Office')} | ForEach-Object { Update-WinGetPackage -Id $.ID }

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.