Automating developer workstation setup has long been a complex challenge in Windows environments. Traditional provisioning approaches rely on fragile batch files, custom PowerShell scripts, or complex configuration management agents that can break across operating system updates. With the introduction of WinGet Configuration (via winget configure), Microsoft introduced a native, declarative Desired State Configuration (DSC) framework that provisions software, enables Windows optional features, and customises system settings from a single YAML manifest.
What is winget configure?
The winget configure command reads a structured YAML file and orchestrates the system into the desired target state. Key characteristics include:
- Declarative Architecture: You describe what your workstation should look like rather than writing procedural scripts on how to get there.
- Idempotent Execution: Safe to run multiple times; only applies modifications if the target component is missing or misconfigured.
- DSC Resource Integration: Interfaces with Microsoft.WinGet.DSC and external DSC modules to install apps, configure Developer Mode, enable Hyper-V, and configure Git.
- Secure Validation: Prompts the user with a comprehensive dependency summary and sandbox isolation before making system-level changes.
Structure of a WinGet Configuration File
A configuration file uses standard YAML and contains a resources array declaring individual modules and states. Here is a baseline developer workstation template:
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2.json
properties:
resources:
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install Visual Studio Code
allowPrerelease: false
settings:
id: Microsoft.VisualStudioCode
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install Git
settings:
id: Git.Git
source: winget
- resource: Microsoft.Windows.Developer/DeveloperMode
directives:
description: Enable Windows Developer Mode
settings:
Ensure: Present
configurationVersion: 0.2.0
Executing a Configuration File Step-by-Step
To provision a Windows 11 computer using a configuration file:
- Save your YAML manifest to a local directory as
dev-workstation.winget. - Open Windows Terminal as Administrator.
- Execute the configuration command:
winget configure -f dev-workstation.winget
- WinGet parses the manifest, downloads necessary DSC resource modules, and presents an interactive summary of all planned changes.
- Review the prompt and confirm execution by typing
Y. - WinGet installs the designated packages, toggles system features, and verifies that the system has achieved the intended configuration state.
Automating Unattended Deployments
For automated enterprise staging or virtual machine provisioning where manual confirmation is impractical, pass the acceptance flags:
winget configure -f dev-workstation.winget --accept-configuration-agreements --disable-interactivity
Core WinGet DSC Resources
| DSC Resource Module | Primary Use Case | Key Settings |
|---|---|---|
Microsoft.WinGet.DSC/WinGetPackage |
Installs or updates applications via package repositories | id, source, version |
Microsoft.Windows.Developer/DeveloperMode |
Toggles Windows 11 Developer Mode for sideloading | Ensure: Present |
Microsoft.Windows.Developer/VirtualMachinePlatform |
Enables WSL2 and hypervisor virtualization prerequisites | Ensure: Present |
GitDsc/GitConfig |
Configures global Git username, email, and default branch | userName, userEmail |
Adopting winget configure brings modern DevOps infrastructure-as-code practices directly to desktop Windows workstations, ensuring developer setups are reliable, reproducible, and verifiable.