Introduction
Here is an example of how to manage your Windows apps with winget (Windows Package Manager and how to use customized build scripts.
The Windows Package Manager contains a command-line interface (winget) and a public app repository to manage apps on your system. It allows installation, update, and deletion of items in your software catalog. A similar and maybe better-known system is chocolatey. So here is how to manage your Windows apps with winget.
Many apps don’t provide automatic update features but with winget, you can still get the most recent versions of any apps on your system automatically. Even after a clean install of the operating system, it can help you install your most needed applications to start with. This is also very handy if you are regularly setting up virtual machines.
Install winget
The app should already be installed on your system if you have a recent version of Windows 10 or 11. To verify, open any command-line tool (like cmd or Powershell) and execute the command winget -v
.
If you see an error message that the command is unknown, follow these installation steps to get the app.
- Open Microsoft Store
- Look for App-Installer
- Update the app
winget is distributed via the AppInstaller app and should now be part of your local system. Verify by executing the command above once more.
If you still have problems with winget, check out the Microsoft documentation about the installation process.
Show your local apps
Use the command winget list
to show all installed apps on your system.
For some apps, winget can’t extract the version because they might not be part of the repository. Sometimes winget also fails to match apps that were installed from another source than winget. This will improve in the future. Every entry denoted with winget as source can be managed without problems.
Find apps
Use the command winget search
to show all apps from the repository that match the search query.
winget tells you the reason for every hit. It uses tags, monikers, and the package name to find a match. Use the help (winget search --help
) to see more options for result filtering.
Install apps
Use the command winget install xxx
to install the most recent version of an app.
Update apps
Use the command winget upgrade xxx
to upgrade an installed app to the most recent version. If there isn’t any more recent version, the process stopps.
Build automation scripts
Now we start with the good parts. As you saw, it is simple to manage apps with winget. But it is cumbersome to always enter all commands for an app upgrade. That’s why I want to show you how to create scripts for automation.
To get started, I recommend you have a look at winstall. It’s a web service where you can create scripts with a nice user interface and download the result. See the example image below.
This script will install Spotify, NodeJS, and EarTrumped in the most recent versions on your system. In the next image, there is an example of a customized PowerShell script that I use to update my developer tools.
To complete the automation process, we need to run this script regularly. Therefore you can use tools like the Windows Task Scheduler. Also, have a look at the -h
or --silent
switch of the winget install
and winget upgrade
command. It will request a silent installation without user interaction if available.
Conclusion
In this article, you learned how to manage your Windows apps with winget. App management can be simplified by a lot with the Windows Package Manager. Use it to set up an empty system or automate your software updates with it. Automation fans love this tool!