{"id":20862,"date":"2026-02-04T10:00:13","date_gmt":"2026-02-04T18:00:13","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/?p=20862"},"modified":"2026-02-03T11:47:14","modified_gmt":"2026-02-03T19:47:14","slug":"winget-configuration-set-up-your-dev-machine-in-one-command","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/blog\/winget-configuration-set-up-your-dev-machine-in-one-command","title":{"rendered":"WinGet Configuration: Set up your dev machine in one command"},"content":{"rendered":"<p>I&#8217;ve set up a <em>lot<\/em> of dev machines in my life. Traditionally, this takes a lot of time to get everything just right, but now there&#8217;s a faster way with <a href=\"https:\/\/learn.microsoft.com\/windows\/package-manager\/configuration\/\">WinGet Configuration<\/a> files. Let me show you how to go from a fresh Windows install to a fully configured dev environment with a single command and how <a href=\"https:\/\/github.com\/features\/copilot\/cli\/\">GitHub Copilot CLI<\/a> can help you build these configs.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/2026\/02\/winget-configuration.webp\"><img decoding=\"async\" class=\"alignnone size-full wp-image-20865\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/2026\/02\/winget-configuration.webp\" alt=\"winget configuration image\" width=\"1462\" height=\"758\" srcset=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/2026\/02\/winget-configuration.webp 1462w, https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/2026\/02\/winget-configuration-300x156.webp 300w, https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/2026\/02\/winget-configuration-1024x531.webp 1024w, https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/2026\/02\/winget-configuration-768x398.webp 768w\" sizes=\"(max-width: 1462px) 100vw, 1462px\" \/><\/a><\/p>\n<h2>What is WinGet Configuration?<\/h2>\n<p>WinGet Configuration lets you describe your ideal dev environment in a YAML file, then apply it with one command. Instead of running a bunch of <code>winget install<\/code> commands manually, you declare what you want and let WinGet do the rest.<\/p>\n<h2>Getting started<\/h2>\n<p>Before you can use <code>winget configure<\/code>, you&#8217;ll need to install the WinGet DSC module. Open PowerShell as admin and run:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">Install-Module Microsoft.WinGet.DSC -Force<\/code><\/pre>\n<p>Once that&#8217;s installed, you can run configuration files with:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">winget configure -f configuration.winget<\/code><\/pre>\n<p>WinGet reads your file, installs all your tools, configures your settings, and gets you ready to code.<\/p>\n<p>The best part is that these configs are <strong>idempotent<\/strong>, which means you can run them multiple times and they&#8217;ll only change what needs changing. For example if you already have VS Code installed, it skips it and moves on.<\/p>\n<div><\/div>\n<div><div class=\"alert alert-success\"><p class=\"alert-divider\"><i class=\"fabric-icon fabric-icon--Lightbulb\"><\/i><strong>Tip:<\/strong><\/p>Add <code>--accept-configuration-agreements<\/code> to skip the confirmation prompts for automated scenarios.<\/div><\/div>\n<h2>How is this different from WinGet import\/export?<\/h2>\n<p>If you&#8217;ve used WinGet before, you might be thinking &#8220;wait, can&#8217;t I already do this with <code>winget export<\/code> and <code>winget import<\/code>?&#8221; This is a great question and they&#8217;re designed to solve different problems.<\/p>\n<p><code>winget import\/export<\/code> creates a simple JSON list of installed packages:<\/p>\n<div>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\"># Export your installed packages\r\nwinget export -o packages.json\r\n# Import on another machine\r\nwinget import -i packages.json<\/code><\/pre>\n<\/div>\n<p>This works, but it <em>only<\/em> handles package installation. It&#8217;s basically a batch install script.<\/p>\n<p><code>winget configure<\/code> is much more powerful:<\/p>\n<table style=\"border-collapse: collapse; width: 100%; height: 216px;\">\n<tbody>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\"><strong>Feature<\/strong><\/td>\n<td style=\"width: 33.3333%; height: 24px;\"><strong>import\/export<\/strong><\/td>\n<td style=\"width: 33.3333%; height: 24px;\"><strong>configure<\/strong><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">Install packages<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">\u2705<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">\u2705<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">Configure Windows settings<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">\u274c<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">\u2705<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">Enable Developer Mode<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">\u274c<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">\u2705<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">Install VS workloads<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">\u274c<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">\u2705<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">Set environment variables<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">\u274c<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">\u2705<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">Define dependencies<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">\u274c<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">\u2705<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">Check OS requirements<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">\u274c<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">\u2705<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">Run PowerShell DSC resources<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">\u274c<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">\u2705<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Think of <code>import\/export<\/code> as a grocery list and <code>configure<\/code> as a complete recipe. The grocery list tells you what to buy, but the recipe tells you what to buy <em>and<\/em> how to put it all together.<\/p>\n<p>For simple app installation scenarios, <code>winget import<\/code> is great. But if you want a fully configured dev environment with Developer Mode enabled, VS workloads installed, and settings configured, use <code>winget configure<\/code>.<\/p>\n<h2>Your first configuration file<\/h2>\n<p>Let&#8217;s start simple. Create a file called <code>dev-setup.winget<\/code>:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\"># yaml-language-server: $schema=https:\/\/aka.ms\/configuration-dsc-schema\/0.2\r\nproperties:\r\n  configurationVersion: 0.2.0\r\n  resources:\r\n    - resource: Microsoft.WinGet.DSC\/WinGetPackage\r\n      directives:\r\n        description: Install Visual Studio Code Insiders\r\n        securityContext: elevated\r\n      settings:\r\n        id: Microsoft.VisualStudioCode.Insiders\r\n        source: winget\r\n\r\n    - resource: Microsoft.WinGet.DSC\/WinGetPackage\r\n      directives:\r\n        description: Install Git\r\n        securityContext: elevated\r\n      settings:\r\n        id: Git.Git\r\n        source: winget\r\n\r\n    - resource: Microsoft.WinGet.DSC\/WinGetPackage\r\n      directives:\r\n        description: Install Node.js LTS\r\n        securityContext: elevated\r\n      settings:\r\n        id: OpenJS.NodeJS.LTS\r\n        source: winget\r\n\r\n    - resource: Microsoft.WinGet.DSC\/WinGetPackage\r\n      directives:\r\n        description: Install Windows Terminal Preview\r\n      settings:\r\n        id: Microsoft.WindowsTerminal.Preview\r\n        source: winget<\/code><\/pre>\n<p>Run it with:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">winget configure -f dev-setup.winget<\/code><\/pre>\n<p>WinGet prompts you for admin approval once, then handles all the installations. Go grab a coffee and come back to a configured machine. \u2615<\/p>\n<h2>Adding Windows settings<\/h2>\n<p>You can do more than install packages, you can configure Windows itself. Here&#8217;s how to enable Developer Mode and dark mode automatically:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">- resource: Microsoft.Windows.Settings\/WindowsSettings\r\n  directives:\r\n    description: Enable Developer Mode\r\n    allowPrerelease: true\r\n    securityContext: elevated\r\n  settings:\r\n    DeveloperMode: true\r\n\r\n- resource: Microsoft.Windows.Developer\/EnableDarkMode\r\n  directives:\r\n    description: Enable dark mode\r\n    allowPrerelease: true\r\n  settings:\r\n    Ensure: Present\r\n    RestartExplorer: true<\/code><\/pre>\n<h2>Using assertions for requirements<\/h2>\n<p>Assertions let you check system requirements before running your config. For example, you can verify the machine meets a minimum OS version:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">properties:\r\n  configurationVersion: 0.2.0\r\n  \r\n  assertions:\r\n    - resource: Microsoft.Windows.Developer\/OsVersion\r\n      directives:\r\n        description: Require Windows 11 22H2 or later\r\n        allowPrerelease: true\r\n      settings:\r\n        MinVersion: '10.0.22621'\r\n  \r\n  resources:\r\n    # Install your tools...<\/code><\/pre>\n<p>If the OS version check fails, the config stops early with a clear message instead of crashing halfway through. This is useful when your tools require specific Windows features only available in newer versions.<\/p>\n<h2>Dependencies between resources<\/h2>\n<p>Sometimes you need things installed in a specific order. Use <code>dependsOn<\/code> to chain resources:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">- resource: Microsoft.WinGet.DSC\/WinGetPackage\r\n  id: vsPackage\r\n  directives:\r\n    description: Install Visual Studio 2026 Community\r\n    securityContext: elevated\r\n  settings:\r\n    id: Microsoft.VisualStudio.Community\r\n    source: winget\r\n\r\n- resource: Microsoft.VisualStudio.DSC\/VSComponents\r\n  dependsOn:\r\n    - vsPackage\r\n  directives:\r\n    description: Install .NET workload\r\n    allowPrerelease: true\r\n    securityContext: elevated\r\n  settings:\r\n    productId: Microsoft.VisualStudio.Product.Community\r\n    channelId: VisualStudio.18.Release\r\n    components:\r\n      - Microsoft.VisualStudio.Workload.ManagedDesktop<\/code><\/pre>\n<p>The <code>vsPackage<\/code> installs first, then the workload gets added.<\/p>\n<h2>Using GitHub Copilot CLI to generate configs<\/h2>\n<p>Here&#8217;s where it gets fun. First, let&#8217;s make sure Copilot CLI is part of our setup! You can bootstrap it right in your configuration file:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">- resource: Microsoft.WinGet.DSC\/WinGetPackage\r\n  id: copilotCli\r\n  directives:\r\n    description: Install GitHub Copilot CLI\r\n  settings:\r\n    id: GitHub.Copilot\r\n    source: winget<\/code><\/pre>\n<p>Now when you run your config on a fresh machine, Copilot CLI gets installed automatically. Once it&#8217;s installed, you can use it to generate <em>more<\/em> configs.<\/p>\n<p>Instead of writing YAML by hand, I ask Copilot CLI to generate configs for me:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">copilot<\/code><\/pre>\n<p>Then I prompt:<\/p>\n<blockquote>\n<div>&#8220;Create a winget configuration file for a Python data science developer. Include Python 3.12, VS Code, Git, and Anaconda.&#8221;<\/div>\n<\/blockquote>\n<p>Copilot generates a complete config that I can tweak and save. This is so much faster than looking up package IDs manually.<\/p>\n<h3>Finding package IDs<\/h3>\n<p>Not sure what the exact package ID is? Ask Copilot:<\/p>\n<blockquote>\n<div>&#8220;What&#8217;s the winget package ID for the latest Python?&#8221;<\/div>\n<\/blockquote>\n<p>It&#8217;ll tell you <code>Python.Python.3.12<\/code> (or whichever version is current).<\/p>\n<h3>Converting existing scripts<\/h3>\n<p>Have an old PowerShell script that installs your tools? Copilot can convert it:<\/p>\n<blockquote>\n<div>&#8220;Convert this script to a winget configuration file:<\/div>\n<div>winget install Microsoft.VisualStudioCode<\/div>\n<div>winget install Git.Git<\/div>\n<div>winget install OpenJS.NodeJS.22&#8243;<\/div>\n<\/blockquote>\n<p>It creates the proper YAML structure with descriptions and everything.<\/p>\n<h3>Explaining configs<\/h3>\n<p>Found a config file in a repo and not sure what it does? Paste it and ask:<\/p>\n<blockquote>\n<div>&#8220;Explain what this winget configuration does and what will be installed&#8221;<\/div>\n<\/blockquote>\n<p>This is super helpful when you&#8217;re onboarding to a new project.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/2026\/02\/winget-dsc.webp\"><img decoding=\"async\" class=\"alignnone wp-image-20880 size-large\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/2026\/02\/winget-dsc-1024x531.webp\" alt=\"Terminal window showing WinGet Desired State Configuration view.\" width=\"1024\" height=\"531\" srcset=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/2026\/02\/winget-dsc-1024x531.webp 1024w, https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/2026\/02\/winget-dsc-300x156.webp 300w, https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/2026\/02\/winget-dsc-768x398.webp 768w, https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/2026\/02\/winget-dsc.webp 1462w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<h2>The export command: Reverse-engineer your setup<\/h2>\n<p>One of my favorite features is <code>winget configure export<\/code>. It captures your current machine state so you can recreate it later:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\"># Export your entire package configuration\r\nwinget configure export -o my-machine.winget --all\r\n# Export just one package's config\r\nwinget configure export -o vscode.winget --package-id Microsoft.VisualStudioCode<\/code><\/pre>\n<p>This is great for:<\/p>\n<ul>\n<li>Backing up your current setup before a fresh install<\/li>\n<li>Creating a config from a machine that&#8217;s already &#8220;just right&#8221;<\/li>\n<li>Sharing your exact environment with teammates<\/li>\n<\/ul>\n<h2>Store configs in your repos<\/h2>\n<p>For project-specific setups, store your config in the repo at <code>.config\/configuration.winget<\/code>. When new contributors clone your project, they can run:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">winget configure -f .config\/configuration.winget<\/code><\/pre>\n<p>This way, they&#8217;ll have the exact same environment as everyone else.<\/p>\n<h2>My configuration file<\/h2>\n<p>Here&#8217;s what my personal dev setup config looks like:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\"># yaml-language-server: $schema=https:\/\/aka.ms\/configuration-dsc-schema\/0.2\r\nproperties:\r\n  configurationVersion: 0.2.0\r\n  \r\n  resources:\r\n    # Enable Developer Mode and dark mode\r\n    - resource: Microsoft.Windows.Settings\/WindowsSettings\r\n      directives:\r\n        description: Enable Developer Mode\r\n        allowPrerelease: true\r\n        securityContext: elevated\r\n      settings:\r\n        DeveloperMode: true\r\n    \r\n    - resource: Microsoft.Windows.Developer\/EnableDarkMode\r\n      directives:\r\n        description: Enable dark mode\r\n        allowPrerelease: true\r\n      settings:\r\n        Ensure: Present\r\n        RestartExplorer: true\r\n    \r\n    # Terminal and shell\r\n    - resource: Microsoft.WinGet.DSC\/WinGetPackage\r\n      directives:\r\n        description: Install Windows Terminal Preview\r\n      settings:\r\n        id: Microsoft.WindowsTerminal.Preview\r\n        source: winget\r\n    \r\n    - resource: Microsoft.WinGet.DSC\/WinGetPackage\r\n      directives:\r\n        description: Install PowerShell 7\r\n        securityContext: elevated\r\n      settings:\r\n        id: Microsoft.PowerShell\r\n        source: winget\r\n    \r\n    - resource: Microsoft.WinGet.DSC\/WinGetPackage\r\n      directives:\r\n        description: Install Oh My Posh\r\n      settings:\r\n        id: JanDeDobbeleer.OhMyPosh\r\n        source: winget\r\n    \r\n    # Development tools\r\n    - resource: Microsoft.WinGet.DSC\/WinGetPackage\r\n      directives:\r\n        description: Install Visual Studio Code Insiders\r\n        securityContext: elevated\r\n      settings:\r\n        id: Microsoft.VisualStudioCode.Insiders\r\n        source: winget\r\n\r\n    - resource: Microsoft.WinGet.DSC\/WinGetPackage\r\n      id: vsPackage\r\n      directives:\r\n        description: Install Visual Studio 2026\r\n        securityContext: elevated\r\n      settings:\r\n        id: Microsoft.VisualStudio.Enterprise\r\n        source: winget\r\n\r\n    - resource: Microsoft.VisualStudio.DSC\/VSComponents\r\n      dependsOn:\r\n        - vsPackage\r\n      directives:\r\n        description: Install .NET workload\r\n        allowPrerelease: true\r\n        securityContext: elevated\r\n      settings:\r\n        productId: Microsoft.VisualStudio.Product.Enterprise\r\n        channelId: VisualStudio.18.Release\r\n        components:\r\n          - Microsoft.VisualStudio.Workload.ManagedDesktop\r\n    \r\n    - resource: Microsoft.WinGet.DSC\/WinGetPackage\r\n      directives:\r\n        description: Install .NET SDK 10\r\n        securityContext: elevated\r\n      settings:\r\n        id: Microsoft.DotNet.SDK.10\r\n        source: winget\r\n    \r\n    - resource: Microsoft.WinGet.DSC\/WinGetPackage\r\n      directives:\r\n        description: Install Azure Developer CLI\r\n      settings:\r\n        id: Microsoft.Azd\r\n        source: winget\r\n    \r\n    - resource: Microsoft.WinGet.DSC\/WinGetPackage\r\n      directives:\r\n        description: Install Git\r\n        securityContext: elevated\r\n      settings:\r\n        id: Git.Git\r\n        source: winget\r\n    \r\n    - resource: Microsoft.WinGet.DSC\/WinGetPackage\r\n      directives:\r\n        description: Install Node.js\r\n        securityContext: elevated\r\n      settings:\r\n        id: OpenJS.NodeJS.LTS\r\n        source: winget\r\n\r\n    # AI tools\r\n    - resource: Microsoft.WinGet.DSC\/WinGetPackage\r\n      directives:\r\n        description: Install GitHub Copilot CLI\r\n      settings:\r\n        id: GitHub.Copilot\r\n        source: winget<\/code><\/pre>\n<p>Feel free to use this as a starting point and customize it for your needs!<\/p>\n<h2>Cheers!<\/h2>\n<p>WinGet Configuration has genuinely changed how I think about machine setup. It&#8217;s version-controlled, repeatable, and shareable. Combined with GitHub Copilot CLI for generating and understanding configs, it&#8217;s never been easier to get a new machine ready for development.<\/p>\n<p>If you have questions or want to share your own configuration files, find me on Bluesky (<a href=\"https:\/\/bsky.app\/profile\/kaylacinnamon.bsky.social\">@kaylacinnamon<\/a>) or X (<a href=\"https:\/\/x.com\/cinnamon_msft\">@cinnamon_msft<\/a>)!<\/p>\n<p>Got any top tips on you handle dev machine configuration? Let us know in the comments!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve set up a lot of dev machines in my life. Traditionally, this takes a lot of time to get everything just right, but now there&#8217;s a faster way with WinGet Configuration files. Let me show you how to go from a fresh Windows install to a fully configured dev environment with a single command [&hellip;]<\/p>\n","protected":false},"author":3539,"featured_media":20880,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[159,132,167],"tags":[184,185],"class_list":["post-20862","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-github-copilot","category-microsoft-for-developers","category-package-management","tag-github-copilot-cli","tag-winget"],"acf":[],"blog_post_summary":"<p>I&#8217;ve set up a lot of dev machines in my life. Traditionally, this takes a lot of time to get everything just right, but now there&#8217;s a faster way with WinGet Configuration files. Let me show you how to go from a fresh Windows install to a fully configured dev environment with a single command [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/wp-json\/wp\/v2\/posts\/20862","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/wp-json\/wp\/v2\/users\/3539"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/wp-json\/wp\/v2\/comments?post=20862"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/wp-json\/wp\/v2\/posts\/20862\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/wp-json\/wp\/v2\/media\/20880"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/wp-json\/wp\/v2\/media?parent=20862"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/wp-json\/wp\/v2\/categories?post=20862"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/wp-json\/wp\/v2\/tags?post=20862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}