this post's header image

The built-in Windows package manager

I do my development on a VM. I like the feeling of a new computer without any of the bloat or history of previous installations. Whenever I move to a new machine, I have to install a myriad of products. It takes my focus away from the fun stuff like making my computer look like it's in 1985.

My previous solution

After I started doing this professionally, this became more of a headache. I looked around and found Chocolatey - a third party package manager. It was good, but there were often failures and I was annoyed with having the first line of the powershell script taken up with the installation of the tool. It just looked clunky:

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString(''))

In comes WinGet

As soon as I found out about WinGet, I installed the Windows Insider Preview. Now, the latest version of Windows seems to include WinGet.

After switching to WinGet, I had less failures. My scripts seemed to just run. The only caveat is that WinGet has trouble deciphering which project you're trying to install unless you use the "-e" flag and specify the exact name.

Here's my personal script to install my dev tools.

winget install -e Microsoft.VisualStudioCode
winget install -e Microsoft.VisualStudio.Community
winget install -e Microsoft.PowerToys
winget install -e Microsoft.Teams
winget install -e Git.Git
winget install -e Microsoft.AzureFunctionsCoreTools
winget install -e Microsoft.AzureDataStudio
winget install -e Microsoft.AzureCLI
winget install -e Microsoft.dotnet

I'm obviously working at a Microsoft shop, but there are lots of development options. You can always search something with winget search <your tool>.

Respond to this post and join the conversation on DEV