How can one use winget to uninstall multiple packages at the same time?
My solution was repeat the command, like this:
winget uninstall --id "Microsoft.ZuneVideo_8wekyb3d8bbwe"
&& winget uninstall --id "Microsoft.YourPhone_8wekyb3d8bbwe"
But is there a better way?
winget uninstallonly supports uninstalling one package at a time, so you'll have to make a call for each of the multiple packages you want to uninstall, which you can easily do withForEach-Object(whose built-in alias is%, if you're looking for a shorter solution for interactive use):This will uninstall the specified packages sequentially.
While there are ways to run the uninstallation commands in parallel, notably with
ForEach-Object -Parallelin PowerShell (Core) 7+, doing so may cause interference between the uninstallation operations.