Managing and updating packages using Winget can sometimes be a tedious process, especially when you have to manually copy and paste package IDs one by one. Here's a solution to simplify your life — a PowerShell script that automates this task.
The Problem
Each time I need to update a bunch of packages using Winget, I end up constructing a line like this in my PowerShell session, which involves a lot of copying and pasting:
winget update --id package.id1; winget update --id package.id2; ... ; winget update --id package.idN
). So, you often need to use --name instead of --id.
The Solution
To solve this, I wrote a PowerShell script that lists all possible updates for installed packages when called without arguments. Then it accept a list of package IDs as an argument and upgrade the listed packages. Note: I still copy and paste IDs of desired packages anyway. 😅 ("HelpWanted")
.
Place the Script Anywhere: Place the script in any directory of your choice.
Set Alias in $PROFILE: Add an alias to your
$PROFILE for easy access.Set-Alias -Name wup -Value "Path\To\Script.ps1"
Now, you can simply run wup in your PowerShell session to list updates or provide specific package IDs to update.
Notes
gist with script contains a Readme.md with more PowerShell thoughts.
If you have any questions or improvements, feel free to contribute!
All code is licensed under the MIT License. Happy updating!
By the way, did you hear about the scrambled developer who couldn’t find his packages? He said, "I guess I’m just egg-sasperated!" 🥚
SOCIAL SHARE CARD GENERATOR