Windows Terminal + WinGet: Automating Your Dev Machine Setup

Setting up a new Windows dev machine used to mean an hour of clicking through installer wizards. With WinGet’s manifest and configuration support, you can turn that into a single reproducible file — much closer to how Linux and macOS developers have scripted their setups for years.

The Basics: Installing Packages with WinGet

# Search for a package
winget search "Visual Studio Code"

# Install a specific package
winget install --id Microsoft.VisualStudioCode -e

# Update everything at once
winget upgrade --all

Exporting Your Current Setup

If you already have a machine set up the way you like it, export a list of installed packages so you can reproduce it elsewhere:

winget export -o C:\dev\winget-packages.json

Declarative Setup with winget configure

WinGet’s Configuration feature (built on DSC – Desired State Configuration) lets you describe an entire dev environment in a YAML file — packages, settings, and features — and apply it in one command.

# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
properties:
  resources:
    - resource: Microsoft.WinGet.DSC/WinGetPackage
      id: git
      directives:
        description: Install Git
      settings:
        id: Git.Git
        source: winget

    - resource: Microsoft.WinGet.DSC/WinGetPackage
      id: vscode
      directives:
        description: Install VS Code
      settings:
        id: Microsoft.VisualStudioCode
        source: winget

    - resource: Microsoft.WinGet.DSC/WinGetPackage
      id: pwsh
      directives:
        description: Install PowerShell 7
      settings:
        id: Microsoft.PowerShell
        source: winget

    - resource: Microsoft.WinGet.DSC/WinGetPackage
      id: docker
      directives:
        description: Install Docker Desktop
      settings:
        id: Docker.DockerDesktop
        source: winget
  configurationVersion: 0.2.0

Applying the Configuration

winget configure -f .\dev-setup.dsc.yaml

# Preview what would change without applying it
winget configure show -f .\dev-setup.dsc.yaml

Combining It with a Windows Terminal Profile

Check your settings.json (found via Ctrl+, in Windows Terminal, or directly at %LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_*\LocalState\settings.json) into the same dotfiles repo as your DSC config, so a fresh machine gets both the tools and the terminal setup in one pass:

# One-time bootstrap script to run after Windows setup
git clone https://github.com/you/dotfiles.git C:\dev\dotfiles
cd C:\dev\dotfiles

winget configure -f .\windows\dev-setup.dsc.yaml
Copy-Item .\windows\terminal-settings.json `
  "$env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json"

Why This Is Worth Doing

A declarative setup means a new laptop, a wiped machine, or a fresh VM goes from zero to a fully configured dev environment in minutes, with zero manual clicking — and it’s version-controlled, so you can see exactly how your setup evolved over time.