A clean windows installation just feels faster, and as a developer I want a fast machine! Why don’t you just reinstall your machine once a month, you ask? Because it takes a lot of time to set it up just right.
Scripting the reinstall
I wouldn’t be a developer if I didn’t like scripts, so why not script the reinstalling of my machine. Great idea, that’s exactly what I did.
- Part 1: Winget import/export (this post)
Winget is a Windows command line package manager. It works great to install a lot of software.
spotify on winget:
winget search spotify. Install spotify:
winget install Spotify.Spotify, and boom Spotify is installed. No need to
next click through a setup.
You can also export all currently installed packages (that are available in winget).
winget export [filename]
You will end up with a json file similar to this one.
Now you got that file exported from your old install (and saved it somewhere save), let’s reinstall all those programs in one go.
winget import -i [filename]
If you’re like me, and got a huge amount of packages in your winget file, this is a great moment to get yourself some coffee or go for lunch. Winget will automatically download and install all the packages specified. In my case it will be downloading Visual studio 2022 professional, Office, Teams and VSCode, among others.