Skip to content

How-ToOS

How to Set Up a New Windows PC With a WinGet Configuration File (winget configure)

A WinGet Configuration file lets you set up a new Windows PC with one command. We explain how to export your current apps with winget configure export, read and trim the YAML file, check it is trustworthy, apply it with winget configure on the new PC and deal with failures, using Microsoft's own documentation.

By , Systems & Technical Editor

6 min read

How to Set Up a New Windows PC With a WinGet Configuration File (winget configure)

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.

The bottom line

A WinGet Configuration file turns new-PC setup into one command: export your current apps with winget configure export --all, trim the YAML file to what you actually want, check every package and module, then run winget configure -f on the new PC with WinGet 1.6.2631 or later. Review any file before running it, because DSC resources can run arbitrary code, and test files from other people in Windows Sandbox first. For just a list of apps, winget export and import is simpler.

Sources

  1. 01Microsoft Learn, WinGet Configuration
  2. 02Microsoft Learn, How to author a WinGet Configuration file
  3. 03Microsoft Learn, configure command (winget)
  4. 04Microsoft Learn, How to check the trustworthiness of a WinGet Configuration file
  5. 05Microsoft Learn, search command (winget)

About the author

Marcus Thorne

Systems & Technical Editor

Marcus writes Forge PC's step-by-step build, troubleshooting and system optimisation guides. His background spans Windows kernel and power-state diagnostics, UEFI/BIOS configuration, NVMe storage arrays, ATX 3.1 power delivery and running local AI and LLM workloads on consumer graphics cards.

More from Marcus Thorne

Read next

Best Free Emulators for PC in 2026

Best Picks

Best Free Emulators for PC in 2026

The best free emulators for PC in 2026: RetroArch for retro systems in one app, PCSX2 for PS2, Dolphin for GameCube and Wii, DuckStation for PS1 and PPSSPP for PSP. We compare the systems each covers, licences, BIOS needs, hardware requirements and features from each project's official site, and explain how to stay legal with your own games and BIOS dumps.

Hannah Vance6 min

How to Set Up PCSX2 on Windows: Play Your PS2 Games on PC

How-To

How to Set Up PCSX2 on Windows: Play Your PS2 Games on PC

PCSX2 can play much of the PlayStation 2 library on a Windows PC at higher resolutions than the original console. Using PCSX2's official documentation, we explain the hardware you need, how to install it, how to dump the BIOS from your own PS2 and your game discs, which renderer to choose, how to save safely and what to check if games run slowly.

Marcus Thorne8 min

Best Local AI Video Translation and Dubbing Tools in 2026

Best Picks

Best Local AI Video Translation and Dubbing Tools in 2026

Free AI tools can now transcribe a video, translate it and dub it into another language on your own PC. We pick the best: pyVideoTrans, VideoLingo, OpenCreator (formerly KrillinAI) and SoniTranslate, comparing offline use, languages, voices, setup, licences and hardware from each project's official docs.

Hannah Vance5 min

pyVideoTrans vs VideoLingo: Which Local AI Video Translator Should You Use?

Versus

pyVideoTrans vs VideoLingo: Which Local AI Video Translator Should You Use?

pyVideoTrans and VideoLingo are popular open-source tools for translating and dubbing videos with AI on your own PC. Using each project's official docs, we compare installation, speech recognition, translation engines, dubbing voices, offline use, GPU support and licences, and say which suits which job.

Callum Reid4 min