Initialize-DeveloperMachine

0.1.0

Bootstrap a Windows developer machine: relocate caches off C:, install winget tools, set up WSL + Docker Desktop. Modular tasks, idempotent, dry-run support.

Minimum PowerShell version

5.1

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name Initialize-DeveloperMachine -RequiredVersion 0.1.0

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name Initialize-DeveloperMachine -Version 0.1.0

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) gonace. All rights reserved.

Package Details

Author(s)

  • gonace

Tags

Developer Bootstrap Windows WSL DockerDesktop winget Junction Cache NuGet npm

Functions

Initialize-DeveloperMachine

PSEditions

Desktop Core

Dependencies

This module has no dependencies.

Release Notes

First publish of `Initialize-DeveloperMachine` to the PowerShell Gallery.

```powershell
Install-Module Initialize-DeveloperMachine -Scope CurrentUser
Initialize-DeveloperMachine -Task All
```

## What's included

- **Cache + tool home relocation** off `C:` for NuGet, NPM, vcpkg, .NET CLI, Claude, and Docker — via user environment variables and NTFS junctions.
- **WSL setup** (`Wsl` task): installs `Microsoft.WSL` via winget, refreshes the kernel, writes `~/.wslconfig` from your config.
- **WSL distros** (`WslDistros` task): installs each distro you list and relocates the VHDX to the drive you pick.
- **Docker Desktop** (`DockerDesktop` task): bootstraps DD on first run, relocates the `docker-desktop` distro, and patches `CustomWslDistroDir` in `settings-store.json` so DD agrees with the new location.
- **Metadata-driven winget pass**: each task declares its package dependencies; the script unions and dedupes them and runs a single install pass before any task action.
- **Idempotent**: subsequent runs are no-ops by design. A small `%LocalAppData%\Initialize-DeveloperMachine\winget-state.json` tracks packages that install but winget can't redetect afterwards (e.g. `Microsoft.DotNet.Framework.DeveloperPack_4`) so they don't reinstall every run.
- **Dry-run** support: `-WhatIf` previews every state-changing action; `-Confirm` prompts before each one.
- **Configurable** via `Initialize-DeveloperMachine.config.json`. Lookup order: `-ConfigFile` parameter → `$PWD` → `%USERPROFILE%\.config\Initialize-DeveloperMachine\config.json` → module folder.
- **Standardised log levels**: `[INFO]` / `[WARN]` / `[ERROR]` / `[SKIP]` / `[DEBUG]` markers with colour coding so output is easy to scan and CI rules can grep on severity.

## Notes

- **First-time WSL2 activation** on a machine that's never had it enabled requires one reboot before the `DockerDesktop` task's distro registration can complete. Already-active machines aren't affected.
- Tested end-to-end on Windows 11 client. CI runs the path/junction/winget portions on `windows-latest`; full WSL + Docker Desktop bootstrap is exercised manually on developer machines (see README "CI coverage" for the rationale).

See the [README](https://github.com/gonace/Initialize-DeveloperMachine#readme) for full configuration details, the task list, and known winget quirks.

FileList

Version History

Version Downloads Last updated
0.1.2 4 5/7/2026
0.1.1 3 5/7/2026
0.1.0 (current version) 5 5/7/2026