Reinstalling every app by hand after a new build or a clean Windows install is slow and easy to get wrong. Windows Package Manager (WinGet) has a built-in answer: a WinGet Configuration file, a single YAML file that lists the apps and settings you want, which the winget configure command then applies in one go. This guide explains what a configuration file is, how to export one from your current PC, how to check it and how to apply it to a new machine, based on Microsoft's WinGet documentation on Microsoft Learn, checked on 29 November 2026.
What a WinGet Configuration file is
Microsoft describes WinGet Configuration as a way to consolidate manual machine setup "to a single command that is reliable and repeatable". It uses three pieces:
A YAML configuration file listing the software, packages, tools and settings that make up the state you want.
PowerShell Desired State Configuration (DSC), which does the actual work of installing packages and changing Windows settings.
The winget configure command, which reads the file and starts the process.
The important difference from a simple install script is that the file is declarative. Rather than a numbered list of steps, it describes the end result you want, and WinGet works out how to get there. Microsoft says the order of resources in the file doesn't matter and some may even run in parallel. If one item fails, the rest of the file carries on, so the machine gets as far as possible; Microsoft notes that it's your responsibility to check for failures once the run completes.
If you only want to reinstall a list of apps, Microsoft points out simpler options: install several packages in one command (winget install A B C), or use winget export and winget import to save and restore a package list. A configuration file is the fuller option because it can also hold settings, such as turning on Developer Mode.
What you need
Windows 10 version 1809 (build 17763) or later, or Windows 11.
WinGet version 1.6.2631 or later.
Administrator approval for some items. Microsoft says the most common reason a configuration fails is a DSC resource that needs administrative access.
If you're new to WinGet itself, start with our guide to installing apps with WinGet, and our Windows Terminal guide if you want a nicer place to run the commands.
Step 1: Export a configuration from your current PC
The easiest way to get a starting file is to let WinGet write it for you. The winget configure export subcommand exports configuration resources to a file, and with --all it exports all package configurations:
winget configure export -o C:\Users\you\Documents\mypc.winget --all
You can also export a single app with --package-id, for example winget configure export -o mypc.winget --package-id Devolutions.UniGetUI. If the output file already exists, Microsoft says the export appends to it rather than overwriting it, so you can build a file up a package at a time.
Microsoft's naming convention is a .winget extension, such as configuration.winget. Copy the file to a USB stick or cloud storage so you can reach it from the new PC.
Step 2: Read and trim the file
Open the file in a text editor before you use it. Microsoft recommends Visual Studio Code with Red Hat's YAML extension, which checks the syntax against the WinGet Configuration schema and offers auto-completion. A configuration file has two main parts under a properties node:
assertions: preconditions, such as a minimum Windows version. If an assertion fails, any resource that depends on it is skipped.
resources: the packages to install and settings to apply.
Each resource names a PowerShell module and DSC resource in the form {ModuleName}/{DscResource}, and must include directives (including a description) and settings. A package install uses Microsoft.WinGet.DSC/WinGetPackage with the package id and source: winget. Microsoft's own example looks like this (shortened):
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
properties:
assertions:
- resource: Microsoft.Windows.Developer/OsVersion
directives:
description: Verify min OS version requirement
allowPrerelease: true
settings:
MinVersion: '10.0.22000'
resources:
- resource: Microsoft.Windows.Settings/WindowsSettings
directives:
description: Enable Developer Mode
allowPrerelease: true
securityContext: elevated
settings:
DeveloperMode: true
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: vsPackage
directives:
description: Install Visual Studio 2022 Community
securityContext: elevated
settings:
id: Microsoft.VisualStudio.2022.Community
source: winget
configurationVersion: 0.2.0
A few details worth knowing:
securityContext: elevated marks a resource that needs admin rights. WinGet then asks for one UAC approval at the start and runs elevated and non-elevated resources in two separate processes.
dependsOn makes one resource wait for another, using the other resource's id. If the dependency fails, the dependent resource fails too.
allowPrerelease: true lets WinGet use prerelease modules from the PowerShell Gallery.
To add an app, find its exact ID with winget search, for example winget search vscode; the ID includes the publisher and app name. Delete anything you don't want on the new PC, such as old utilities or vendor apps for hardware you no longer own.
Step 3: Check that the file is trustworthy
Treat a configuration file like any script. Microsoft's warning is clear: don't run one without reviewing its contents and the related resources first. Its trustworthiness guidance adds that PowerShell DSC resources "can be configured to run any arbitrary code", and that running winget configure from an administrator shell means you won't be prompted for system changes made in that context. In a normal shell you may get only a single UAC prompt for the whole run.
For a file you exported yourself, the main job is checking that every package is something you recognise. For a file from someone else, check every package and every DSC module, and Microsoft recommends testing it in an isolated environment first. Windows Sandbox is a convenient place to do that. You can also run winget configure validate -f mypc.winget to check the file, and winget configure show -f mypc.winget to list what it will do.
Step 4: Apply it on the new PC
On the new machine, make sure WinGet is at least version 1.6.2631, then either double-click the configuration file in File Explorer or run:
winget configure -f D:\mypc.winget
WinGet parses the file, downloads the PowerShell modules it needs, shows you the details and asks you to confirm that you've checked the file. It then tests the assertions and applies the resources. Microsoft says modules are stored in %LOCALAPPDATA%\Microsoft\WinGet\Configuration\Modules by default; you can change that with --module-path.
Useful options and subcommands from Microsoft's reference:
--accept-configuration-agreements skips the confirmation prompt. Only use it for a file you've already reviewed.
--verbose turns on verbose logging, and --logs opens the log folder.
winget configure test -f mypc.winget checks whether the PC already matches the file, which is handy for confirming a run worked.
winget configure list shows configurations that have been applied to the system.
When something fails
Because the file keeps going after an error, read the summary at the end. Microsoft's example shows how one failed assertion (an OS version check) causes the resources that depend on it to be reported as not run, while unrelated items continue. If a resource fails without explanation, try again from a shell where you can approve elevation, as admin rights are the most common cause. Microsoft says it plans to add more troubleshooting guidance and points to the WinGet CLI repository on GitHub for known issues in the meantime.
Drivers are a separate job: a configuration file is about apps and settings, so get chipset and graphics drivers from your motherboard and GPU makers (see our Device Manager driver guide). For a full fresh build, our Windows 11 install guide for a new PC covers the earlier steps, and our list of the best free apps for a new gaming PC can help you decide what goes in the file.