Improving My Winget Bulk App Installer Script (Premium)

I've been automating app installs in Windows 11 using the Windows Package Manager (winget) for the past year or so, and given how many laptops I review, and how many times I reset PCs because of my book and testing work, this process has saved me an incredible amount of time. But I keep tinkering with the script I use for automated app installs, mostly by adding and removing apps as needed. And each time I go through this process, I'm reminded of some more profound improvements I'd like to make. And this week, I finally decided to put in the work.

For those unfamiliar with this work, please check out my previous articles on this topic, most notably Tip: Use Winstall and Winget to Bulk Install Apps and Roll Your Own Windows Time Machine (Premium). But here are the basics. Windows Package Manager (winget) is a command-line package manager built into Windows 10 and 11 that can automate the installation (and updating) of Windows apps sourced from the Microsoft Store and/or the web, in the latter case using the Windows Package Manager repository. You can install one app using a single command line, or you can create a script that bulk installs multiple apps all at once. And that's what I do.

Last year, my install script was simple enough. It looked like so:
winget install --id=Microsoft.VisualStudioCode -e ; winget install --id=Brave.Brave -e ; winget install --id=Microsoft.Teams -e ; winget install --id=Microsoft.Skype -e ; winget install --id=Discord.Discord -e ; winget install --id=Notion.Notion -e ; winget install --id=Greenshot.Greenshot -e
As noted, I've since added many more apps to the script. The version I was using before the changes documented here looked like so:
winget install --id=Brave.Brave -e ; winget install --id=appmakes.Typora -e ; winget install --id=Microsoft.VisualStudioCode -e ; winget install --id=Google.Chrome -e ; winget install --id=Microsoft.Teams -e ; winget install --id=Microsoft.Skype -e ; winget install --id=Discord.Discord -e ; winget install --id=Notion.Notion -e ; winget install --id=Greenshot.Greenshot -e ; winget install --id=Git.Git -e ; winget install --id=Zoom.Zoom -e ; winget install --id=SlackTechnologies.Slack -e ; winget install --id=Microsoft.DotNet.SDK.8 -e ; winget install --id=Google.GoogleDrive -e
This works well enough. But as noted, I have identified some changes I'd like to make to the script to improve it. From an efficiency standpoint, it's not truly automated because I have to respond to a few license agreements and some of the app setup routines trigger User Account Control (UAC) prompts that will cancel the app install if not addressed, while others try to run interactive installers. The script can only be run on a new installation of Windows, but it would be nice if I could run it against any install and have it simply ignore the apps that are already installed. And I want to ensure that I'm using the Microsoft Store as the install source as often as possible (for reasons noted be...

Gain unlimited access to Premium articles.

With technology shaping our everyday lives, how could we not dig deeper?

Thurrott Premium delivers an honest and thorough perspective about the technologies we use and rely on everyday. Discover deeper content as a Premium member.

Tagged with

Share post

Please check our Community Guidelines before commenting

Windows Intelligence In Your Inbox

Sign up for our new free newsletter to get three time-saving tips each Friday

"*" indicates required fields

This field is for validation purposes and should be left unchanged.

Thurrott © 2024 Thurrott LLC