You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
winget upgrade is expecting exactly one pacakge name to perform a specifc update.
It would be nice to change the syntax to accept a list/sequence/array of package names instead so multiple specific pacakges can be upgrade with 1 command ony instead of repeating for each single pacakge to be upgraded.
Proposed technical implementation details
multiple package to be installed with winget upgrade, for eg:
there is a conflict with the -v | --version option that can't be really used.
so eventually the [<options>] field could be paired with each <package> field, or better extrapolate the version from options:
or simply change the version (-v) syntax to use column : symbol after the package to specify the version:
eg: package1:1.0.0 or pacakge1:latest <- :latest is default so can be omitted => package1
another possibility is to do not touch upgrade command and create a sibling wrapper command upgrades (note the s), that is accepting a list of packages and pipeline them one at time to the upgrade command
in this way it would like to call winget upgrade multiple time eventually.
I like the idea, though I'd suggest to make such upgrades command actually upgrade everything (if no list of packages is provided). Something like apt dist-upgrade or pacman -Syu on Linux. Listing everything manually is painful.
What about making 2 issues?
make upgrade, install and uninstall accept more than one argument (because installing 50 packages one by one on a new machine is also painful)
make upgrade actually update everything if no arguments are provided (or create a separate command)
I like the idea, though I'd suggest to make such upgrades command actually upgrade everything (if no list of packages is provided). Something like apt dist-upgrade or pacman -Syu on Linux. Listing everything manually is painful.
What about making 2 issues?
make upgrade, install and uninstall accept more than one argument (because installing 50 packages one by one on a new machine is also painful)
make upgrade actually update everything if no arguments are provided (or create a separate command)
the problem with install uninstall is that it might requires to click on the UAC or something else, accepting licenses. but would be interesting as well. (this might extends as well sometimes to the update so.... actually could be a problem... 😄 )
upgrade can upgrade all already with --all option.
I like the idea, though I'd suggest to make such upgrades command actually upgrade everything (if no list of packages is provided). Something like apt dist-upgrade or pacman -Syu on Linux. Listing everything manually is painful.
What about making 2 issues?
make upgrade, install and uninstall accept more than one argument (because installing 50 packages one by one on a new machine is also painful)
make upgrade actually update everything if no arguments are provided (or create a separate command)
1. the problem with install uninstall is that it might requires to click on the UAC or something else, accepting licenses. but would be interesting as well. (this might extends as well sometimes to the update so.... actually could be a problem... smile )
2. upgrade can upgrade all already with `--all` option.
This can be solved with accepting licenses one after another, then it could work in the background, popping up the UAC when needed. And if it's not possible, the possibility to provide more than one query, then doing it the same way like now (i.e. accept licence, UAC and so on.. one after another) would be an improvement for me.
I like the idea, though I'd suggest to make such upgrades command actually upgrade everything (if no list of packages is provided). Something like apt dist-upgrade or pacman -Syu on Linux. Listing everything manually is painful.
What about making 2 issues?
make upgrade, install and uninstall accept more than one argument (because installing 50 packages one by one on a new machine is also painful)
make upgrade actually update everything if no arguments are provided (or create a separate command)
1. the problem with install uninstall is that it might requires to click on the UAC or something else, accepting licenses. but would be interesting as well. (this might extends as well sometimes to the update so.... actually could be a problem... smile )
2. upgrade can upgrade all already with `--all` option.
This can be solved with accepting licenses one after another, then it could work in the background, popping up the UAC when needed. And if it's not possible, the possibility to provide more than one query, then doing it the same way like now (i.e. accept licence, UAC and so on.. one after another) would be an improvement for me.
Yeah, I've just noticed my mistake. Thanks
yes could have accept licenses like a --accept-license option to do automatically or something. and UAC just triggering the first time and keep using it (like giving the sudo permission), not sure if there might be any security implication doing this anyway.
I'd like to second this request. Specifically, I need to keep NodeJS LTS at a lower version because we haven't upgraded from 14 LTS to the latest 16 LTS yet, and won't be for some time (16 doesn't even enter Maintenance only mode until September, so we won't look at updating to it until then).
I'd like to do winget upgrade --all --not --id 'OpenJS.NodeJS.LTS" or something to that effect, but at least doing winget upgrade PackageA PackageB PackageC is better than manually running them one at a time.
A second option I could see is to lock my package. So I might run something like winget lock --id 'OpenJS.NodeJS.LTS' and then winget upgrade --all would skip over that particular package. Not sure if any other package managers have that kind of thing though.
As a workaround, I'm wondering if query has support to do this, or if I can write a simple script to take the results from winget upgrade default usage and run upgrade one at a time -- is there a way to just get the Id column output from winget upgrade?
I'm not really seeing a full description of the --query parameters. Can I do something like winget upgrade -q "PackageA|PackageB|PackageC" or possibly winget upgrade --all --query '^OpenJS.NodeJS.LTS (assuming ^ would mean negation in the query)?
Yes, yes, please. 👍🏼👍🏼 ... I was just coming to post this suggestion. upgrade --all is annoying right now, because there's numerous packages that fail/don't upgrade properly (e.g. Microsoft.EdgeWebView2Runtime and Microsoft.dotnet), so doing --all is annoying because it tries to upgrade them and I get UAC and other user prompts, and then still have them in the list anyway.
So, to only deal with the installs that work, without doing multiple commands, I wanted to just do something like winget upgrade Dropbox.Dropbox Microsoft.dotnetRuntime.3-x64
, and was very surprised that that did not work.
Maybe the --query parameter would help for this? As davvolun mentioned, does -q support any kind of advanced pattern matching that could be used to pull a list of items that aren't all simply variants of the same substring? Based on the docs here, it doesn't look like it.
Maybe that can be expanded to support standard RegEx matching? Then like davvolun said, it could be used to specify options (or even fancier matches), such as winget upgrade -q (Dropbox.Dropbox)|(Microsoft.dotnetRuntime.3-x64)
Team, please understand the convenience offered by these two commands in linux world and imitate the same with winget. Users will be okay with whatever approach you take to achieve it. But we need these features as soon as possible, you can't keep discussing this for months and years. Please!!
It only installs what i want, same way we want winget to upgrade only the packages that we want to upgrade.
apt install git npm
Here is another scenario that saves me from accepting UAC popup 10 times or more and I get things done with a simple single line command.
2. Here is another scenario that saves me from accepting UAC popup 10 times or more and I get things done with a simple single line command.
sudo apt upgrade -y
This can be solved by packages like gsudo but remember that achieving the unix feeling ain't as easy as it may seem. It depends also on the app devs and whether they provide some other way to install their apps (instead of the GUI installers). But UAC prompts should disappear with sudo for Windows programs.
Though I agree that lack of response for need no.1 is sad.
I just want to voice my support for this and add my insignificant chaotic pieces to the debate ;)
I think multiple packages support for upgrade/install/uninstall is immensely useful, and coming from Chocolatey world, this missing feature is one of the main reasons I still didn't completely switch to winget
I know that winget has many specifics, and I will not pretend I understand all the implications, but I think you can take plenty of inspiration from Chocolatey because they've been there
I think to make it so upgrade accept more packages is much better than introducing new special command upgrades
It's much more intuitive and flexible to use only one command
it's standard for all win/linux package managers (AFAIK). It would be unwise to go against the flow in this case, it would be simply confusing and winget-specific
I use lots of install/upgrade scripts that are constantly evolving. The potential need for changing command from upgrade to upgrades and back based on the number of packages to upgrade/install/... is an unpleasant thought. Even without scripts involved, the same thing applies to day-to-day ad-hoc upgrades etc
licenses - chocolatey has AFAIK 2 options
--accept-license parameter
you can persist your preference by choco feature enable -n allowGlobalConfirmation, and the license confirmation is away for good
this is more like nice-to-have, but you can prevent a package from upgrading by choco pin <package>. Such package is ignored when running choco upgrade all
regarding UAC - I think this issue is not something that should stand in the way of implementing multi-upgrade/install. UAC is simply there, and there is no easy solution, but you can always work around that, and winget will probably not resolve that in some new way so I think you shouldn't let it stand in the way. I think Chocolatey also does not care too much ;)
gsudo is great, I use it all the time
for bigger installs/upgrades it is better (at least for me) to run shell instance (whether is it conemu/win-terminal/...) in an elevated mode or use something like gsudo pwsh prior to running the upgrades, so the whole session is elevated and I only get one UAC prompt at the start of the session, do what I need and exit the session. So this is not winget-specific, it's damn Microsoft Windows, I hate UAC ;)
I just want to voice my support for this and add my insignificant chaotic pieces to the debate ;)
I think multiple packages support for upgrade/install/uninstall is immensely useful, and coming from Chocolatey world, this missing feature is one of the main reasons I still didn't completely switch to winget
I know that winget has many specifics, and I will not pretend I understand all the implications, but I think you can take plenty of inspiration from Chocolatey because they've been there
I think to make it so upgrade accept more packages is much better than introducing new special command upgrades
It's much more intuitive and flexible to use only one command
it's standard for all win/linux package managers (AFAIK). It would be unwise to go against the flow in this case, it would be simply confusing and winget-specific
I use lots of install/upgrade scripts that are constantly evolving. The potential need for changing command from upgrade to upgrades and back based on the number of packages to upgrade/install/... is an unpleasant thought. Even without scripts involved, the same thing applies to day-to-day ad-hoc upgrades etc
licenses - chocolatey has AFAIK 2 options
--accept-license parameter
you can persist your preference by choco feature enable -n allowGlobalConfirmation, and the license confirmation is away for good
this is more like nice-to-have, but you can prevent a package from upgrading by choco pin <package>. Such package is ignored when running choco upgrade all
regarding UAC - I think this issue is not something that should stand in the way of implementing multi-upgrade/install. UAC is simply there, and there is no easy solution, but you can always work around that, and winget will probably not resolve that in some new way so I think you shouldn't let it stand in the way. I think Chocolatey also does not care too much ;)
gsudo is great, I use it all the time
for bigger installs/upgrades it is better (at least for me) to run shell instance (whether is it conemu/win-terminal/...) in an elevated mode or use something like gsudo pwsh prior to running the upgrades, so the whole session is elevated and I only get one UAC prompt at the start of the session, do what I need and exit the session. So this is not winget-specific, it's damn Microsoft Windows, I hate UAC ;)
Nice points but it looks like you are more oriented (and biased) to use unix systems (Linux, MacOS) rather the Microsoft based ones, and tools like chocolately and gsudo. Then there is no really need to use Winget (and Powershell) i think.
So I am not sure anymore what are the points on your comment that could help improve Winget.
Besides,
to upgrade multiple pacakges without upgrading all (--all) it would be enough that there is an easy way to retrieve the list of IDs of the pacakges instead of the Name | Id | Version | Available | Source table.
so it is very trivial how to upgrade multiple packages in a for loop.
Said so, going a step further, it is still trivial to have a list of pacakges to upgrade and create a for loop to upgrade them.
Because when you want to upgrade some packages you must know their names/ids and have a list of them anyway.
So here there is just the simple trade-off of built-in an internal winget loop or doing it from the CLI with a script calling winget multiple times and each time with just 1 package to upgrade.
Demitrius Nelon (@denelon) what is the point of pinning a pacakge when a pacakge can be upgraded by windows update service or some apps even auto updates like edge and so on? besides isn't a possible security risk pinning a pacakge?
winget cant help it if the package or anther part of the system updates the package themselves, the pin is there to make sure winget doesn't do it, that's it.
yes, but its a security risk to pin a package in apt or any other package manager as well, winget is no different here
Hey all, we've just added multiple packages to the winget install command.
We already had winget import which is why that feature was relatively low in priority.
Some of the arguments don't make sense when installing multiple packages (like "--override") and we've reworked how some of the arguments are handled to give improved behavior and output.
We've also released the experimental support for winget pin in the latest preview release.
Given winget pin it may be easier to achieve the desired result for this Issue with winget upgrade --all. I'm aware of several installers that don't give enough or the correct data for pinning to work properly, but we're continuing to improve the product.
We've shared how we reason about the Roadmap so you can understand how we prioritize work.
Multi-upgrade is also now supported in the lastes preview:
Reacted by Peter Feerick, Bahtiyar Ali ALHAS, TCH, Mirco Dariol, Ali3n, Kristen Skogholt Haave, Vadym, BlairMcClelland, FEh2VZalmw8, Nikolai Kliukai and 3 more
Reacted by Artemis-Hound, JP Roussel and LightBringer81
> winget upgrade --id OpenJS.NodeJS --id Microsoft.VisualStudioCode
Windows Package Manager v1.8.1791
Copyright (c) Microsoft Corporation. All rights reserved.
Argument provided more times than allowed: 'id'
Masamune3210 for some reason I didn't get notified despite being subscribed.
you can't put more than one --id in the command
You should be able to though. Otherwise, multi-user install and upgrade functionality is incomplete. --id is important and useful (otherwise it wouldn't exist). Why can the user only use it with a single package? That's arbitrary.
I know you are able to (or at least at one point we're able to) do install instead of upgrade and if the package was already installed, it would upgrade it
Demitrius Nelon (@denelon) could you educate me? What's the expected workflow here? I guess I could do something like <list(package_ids)> | ForEach-Object { winget upgrade --id $_ } but it just seems arbitrary that a flag is limited to only when installing, uninstalling and upgrading single packages and not multiple. Is it for a similar situation as with --scope, --custom, --accept-package-agreements, --accept-source-agreements, etc. being limited to single-package installs?
Activity
Raffaello commentedon Jan 15, 2022
another possibility is to do not touch
upgradecommand and create a sibling wrapper commandupgrades(note thes), that is accepting a list of packages and pipeline them one at time to theupgradecommandin this way it would like to call winget upgrade multiple time eventually.
skelly37 commentedon Feb 3, 2022
I like the idea, though I'd suggest to make such
upgradescommand actually upgrade everything (if no list of packages is provided). Something likeapt dist-upgradeorpacman -Syuon Linux. Listing everything manually is painful.What about making 2 issues?
upgrade,installanduninstallaccept more than one argument (because installing 50 packages one by one on a new machine is also painful)upgradeactually update everything if no arguments are provided (or create a separate command)Raffaello commentedon Feb 3, 2022
the problem with install uninstall is that it might requires to click on the UAC or something else, accepting licenses. but would be interesting as well. (this might extends as well sometimes to the update so.... actually could be a problem... 😄 )
upgrade can upgrade all already with
--alloption.skelly37 commentedon Feb 3, 2022
Raffaello commentedon Feb 3, 2022
yes could have accept licenses like a
--accept-licenseoption to do automatically or something. and UAC just triggering the first time and keep using it (like giving the sudo permission), not sure if there might be any security implication doing this anyway.davvolun commentedon Mar 8, 2022
I'd like to second this request. Specifically, I need to keep NodeJS LTS at a lower version because we haven't upgraded from 14 LTS to the latest 16 LTS yet, and won't be for some time (16 doesn't even enter Maintenance only mode until September, so we won't look at updating to it until then).
I'd like to do
winget upgrade --all --not --id 'OpenJS.NodeJS.LTS"or something to that effect, but at least doingwinget upgrade PackageA PackageB PackageCis better than manually running them one at a time.A second option I could see is to lock my package. So I might run something like
winget lock --id 'OpenJS.NodeJS.LTS'and thenwinget upgrade --allwould skip over that particular package. Not sure if any other package managers have that kind of thing though.As a workaround, I'm wondering if query has support to do this, or if I can write a simple script to take the results from
winget upgradedefault usage and run upgrade one at a time -- is there a way to just get the Id column output fromwinget upgrade?I'm not really seeing a full description of the
--queryparameters. Can I do something likewinget upgrade -q "PackageA|PackageB|PackageC"or possiblywinget upgrade --all --query '^OpenJS.NodeJS.LTS(assuming ^ would mean negation in the query)?eidylon commentedon Apr 13, 2022
Yes, yes, please. 👍🏼👍🏼 ... I was just coming to post this suggestion.
upgrade --allis annoying right now, because there's numerous packages that fail/don't upgrade properly (e.g.Microsoft.EdgeWebView2RuntimeandMicrosoft.dotnet), so doing--allis annoying because it tries to upgrade them and I get UAC and other user prompts, and then still have them in the list anyway.So, to only deal with the installs that work, without doing multiple commands, I wanted to just do something like
winget upgrade Dropbox.Dropbox Microsoft.dotnetRuntime.3-x64, and was very surprised that that did not work.
Maybe the
--queryparameter would help for this? As davvolun mentioned, does-qsupport any kind of advanced pattern matching that could be used to pull a list of items that aren't all simply variants of the same substring? Based on the docs here, it doesn't look like it.Maybe that can be expanded to support standard RegEx matching? Then like davvolun said, it could be used to specify options (or even fancier matches), such as
winget upgrade -q (Dropbox.Dropbox)|(Microsoft.dotnetRuntime.3-x64)XeroxDev commentedon May 2, 2022
I hope this will be added. Until then, I've created a small ps-function which can be added to the profile.
Usage:
wgetup package1 package2 package3It isn't fancy nor professional, but for private use, it does the job.
pavangayakwad commentedon May 24, 2022
Team, please understand the convenience offered by these two commands in linux world and imitate the same with winget. Users will be okay with whatever approach you take to achieve it. But we need these features as soon as possible, you can't keep discussing this for months and years. Please!!
apt install git npmsudo apt upgrade -yskelly37 commentedon May 24, 2022
Pavan (@pavangayakwad)
This can be solved by packages like gsudo but remember that achieving the unix feeling ain't as easy as it may seem. It depends also on the app devs and whether they provide some other way to install their apps (instead of the GUI installers). But UAC prompts should disappear with sudo for Windows programs.
Though I agree that lack of response for need no.1 is sad.
brkerez commentedon Aug 11, 2022
I just want to voice my support for this and add my insignificant chaotic pieces to the debate ;)
I think multiple packages support for
upgrade/install/uninstallis immensely useful, and coming from Chocolatey world, this missing feature is one of the main reasons I still didn't completely switch to wingetI know that winget has many specifics, and I will not pretend I understand all the implications, but I think you can take plenty of inspiration from Chocolatey because they've been there
upgradeaccept more packages is much better than introducing new special commandupgradesupgradetoupgradesand back based on the number of packages to upgrade/install/... is an unpleasant thought. Even without scripts involved, the same thing applies to day-to-day ad-hoc upgrades etc--accept-licenseparameterchoco feature enable -n allowGlobalConfirmation,and the license confirmation is away for goodchoco pin <package>. Such package is ignored when runningchoco upgrade allgsudois great, I use it all the timegsudo pwshprior to running the upgrades, so the whole session is elevated and I only get one UAC prompt at the start of the session, do what I need and exit the session. So this is not winget-specific, it's damn Microsoft Windows, I hate UAC ;)Raffaello commentedon Aug 11, 2022
Nice points but it looks like you are more oriented (and biased) to use unix systems (Linux, MacOS) rather the Microsoft based ones, and tools like chocolately and gsudo. Then there is no really need to use Winget (and Powershell) i think.
So I am not sure anymore what are the points on your comment that could help improve Winget.
Besides,
to upgrade multiple pacakges without upgrading all (
--all) it would be enough that there is an easy way to retrieve the list of IDs of the pacakges instead of the Name | Id | Version | Available | Source table.so it is very trivial how to upgrade multiple packages in a for loop.
Said so, going a step further, it is still trivial to have a list of pacakges to upgrade and create a for loop to upgrade them.
Because when you want to upgrade some packages you must know their names/ids and have a list of them anyway.
So here there is just the simple trade-off of built-in an internal winget loop or doing it from the CLI with a script calling winget multiple times and each time with just 1 package to upgrade.
10 remaining items
Raffaello commentedon Feb 18, 2023
Demitrius Nelon (@denelon) what is the point of pinning a pacakge when a pacakge can be upgraded by windows update service or some apps even auto updates like edge and so on? besides isn't a possible security risk pinning a pacakge?
Masamune3210 commentedon Feb 18, 2023
winget cant help it if the package or anther part of the system updates the package themselves, the pin is there to make sure winget doesn't do it, that's it.
yes, but its a security risk to pin a package in apt or any other package manager as well, winget is no different here
brkerez commentedon Feb 20, 2023
great news, greatly appreciated, thanks!
denelon commentedon Feb 22, 2023
Multi-upgrade is also now supported in the lastes preview:

github-account1111 commentedon Jul 10, 2024
Could you explain what I'm doing wrong Demitrius Nelon (@denelon)?
winget upgrade --id OpenJS.NodeJSworks fine.Masamune3210 commentedon Jul 12, 2024
you can't put more than one --id in the command
github-account1111 commentedon Aug 27, 2024
Masamune3210 for some reason I didn't get notified despite being subscribed.
You should be able to though. Otherwise, multi-user install and upgrade functionality is incomplete.
--idis important and useful (otherwise it wouldn't exist). Why can the user only use it with a single package? That's arbitrary.Masamune3210 commentedon Aug 27, 2024
I don't know, I just read the error message
Masamune3210 commentedon Aug 27, 2024
I know you are able to (or at least at one point we're able to) do install instead of upgrade and if the package was already installed, it would upgrade it
Maybe that's the intended flow?
github-account1111 commentedon Jan 3, 2025
Demitrius Nelon (@denelon) could you educate me? What's the expected workflow here? I guess I could do something like
<list(package_ids)> | ForEach-Object { winget upgrade --id $_ }but it just seems arbitrary that a flag is limited to only when installing, uninstalling and upgrading single packages and not multiple. Is it for a similar situation as with--scope,--custom,--accept-package-agreements,--accept-source-agreements, etc. being limited to single-package installs?