Initialize-DeveloperMachine.psd1
|
@{ RootModule = 'Initialize-DeveloperMachine.psm1' ModuleVersion = '0.1.0' GUID = 'f3f98b03-1835-4fa7-a0bc-440739c8cee2' Author = 'gonace' CompanyName = 'gonace' Copyright = '(c) gonace. All rights reserved.' Description = 'Bootstrap a Windows developer machine: relocate caches off C:, install winget tools, set up WSL + Docker Desktop. Modular tasks, idempotent, dry-run support.' PowerShellVersion = '5.1' CompatiblePSEditions = @('Desktop','Core') FunctionsToExport = @('Initialize-DeveloperMachine') CmdletsToExport = @() VariablesToExport = @() AliasesToExport = @() PrivateData = @{ PSData = @{ Tags = @('Developer','Bootstrap','Windows','WSL','DockerDesktop','winget','Junction','Cache','NuGet','npm') LicenseUri = 'https://github.com/gonace/Initialize-DeveloperMachine/blob/master/LICENSE' ProjectUri = 'https://github.com/gonace/Initialize-DeveloperMachine' ReleaseNotes = @' 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. '@ } } } |