I rebuilt my Windows PC from a single YAML file and will never click through installers again

You know what’s the worst part about getting a new Windows PC or doing a clean install of Windows? When you first boot, your computer will be empty and it will take many hours to make it yours. As someone who does consumer technology journalism and continues to test new hardware, I’ve been in this situation many times.

After every Windows reinstall, I have to install the same browsers, utilities, launchers, and development tools. These are decisions I made years ago and I repeat them every time. So I decided to find the easy way out and create a winget configuration file this can describe my entire setup.

Export was only half of the work

My export found 150 apps and my browser is not one of them

winget exports end up with a long list of packages that are not available from any source

I have been using winget for years. If you’re not familiar, winget is Microsoft’s official command-line package manager. It’s like apt or apt-get on Linux. You can find, install, remove, and update application packages using Winget commands.

There are many built-in commands and options, but the one that helped me the most in this experiment was export. It allows you to export a list of all installed packages. So I started by running the export command and exported the packages with versions to a JSON file.

winget export -o apps.json --include-versions

The export captured over 150 packages from the Winget source and several from the Microsoft Store. But that wasn’t all the apps I had; it couldn’t export apps that weren’t available from any of the sources, such as manually installed software (Brave, Discord, Postman, and Android Studio, etc.).

Exporting was not the final file that could rebuild my computer. The export is JSON, and the configure command requires a YAML file, so you need to convert it first. I had to manually edit the file to add missing packages and remove packages that were exported twice because I had both system and user installations.

Winget has another interesting command, the configure command. It reads a YAML file and applies it all at once, including applications and Windows settings. It can also import Windows settings, but the export command does not capture these settings. So I manually added three — developer mode, file extensions and hidden files, and dark mode. I could also export the VS Code extensions, but these days I jump from Antigravity to Claude Code more often than VS Code, so I skipped that.

In the end I split one file with 100+ apps and settings. The first file contained basic applications such as development tools, everyday software, and home lab access tools, while the second file contained hardware/supply tools, game launchers, and flight simulation tools.

The next step was to see if it was all theoretical or if it could restore my computer.

I hit Enter on a blank Windows setup

Every app installed itself after a step I didn’t expect

Exporting the file and editing it was not the last step. I had to actually save the file and test it myself to believe it. Unfortunately, I didn’t have a spare Windows laptop, so I used a VM to test the file with a limited number of packages.

I downloaded the latest Windows 11 26H2 ISO file, fired up VMware, and booted to a clean Windows install within minutes. Before doing anything, I cleared all pending windows updates and after that finished, I checked for winget. The new machine was ready with winget v1.11.510.

I moved the YAML file to the VM and tried to create a validation test using winget configure validate. But for the first time winget configurit failed because it had to be added manually. After I added it using winget configure --enableand ran the check again, it didn’t return any issues. So, it was good that I left.

Note that the VM test file had three Windows settings and 14 apps instead of all 150+ apps. I ran the winget configure command and measured the time. It installed the apps successfully, but only used two of the three Windows settings I added. Because PowerShell was not running as administrator and Size-Order it covered up the failure for the first time.

Measure-Command { winget configure -f workstation-vm-test.dsc.yaml --accept-configuration-agreements }

With these settings and 14 apps, the test took 14 minutes and 26.8 seconds, but it could have been less because I missed some UAC prompts and left them waiting. So, I ran the test again on a new VM; it arrived in 12 minutes. This proved that the configuration file worked for those 14 applications and could be used later. But there were a few things he couldn’t take back.

File never promised

The programs came back, but none of them remembered me

There is a difference between installation and configuration. The Winget configuration file may install the apps successfully, but when I open the apps everything is fresh. Browsers do not have profiles, history and passwords; utility applications are logged out. VS Code didn’t have extensions; well that happened to me. I did not export them.

I noticed one more thing. The file contained versions for each application, but they were not fixed; the device has newer versions than my computer. For example, Node 22.23.2 vs 22.14, Python 3.13.15 vs 3.13.3, and Git 2.55.0 vs 2.53.0. I haven’t had any problems with it, but if you’re on a certain build of your app, you’ll have to edit it manually.

Licensed applications like MS Office and Adobe Suite were another responsibility on my shoulders. They are left to me because each requires individual authentication. I left out a few sensitive things like SSH keys and git credentials for obvious reasons. I haven’t checked the taskbar and Start layout, default apps, and display scaling, so I can’t comment on that.

But for me, I can live with these trade-offs. If I neglected to add winget configuration before running the file, this is just one command that helped me install all the apps and use windows settings.

Base, not backup

This little experiment showed me that a single wing configuration file can reduce the repetitive and boring task of installing most legacy applications. The file gave me a starting point, not an exact copy of my old computer. But I didn’t want to get an exact copy anyway, because it’s not safe to store logins and licenses in a YAML file, and drivers are device-specific, so there’s no point in moving them around. Finally, a documented, repeatable baseline is much better than starting from scratch and relying on your memory.

Leave a Comment