Skip to content

Add a resumable PowerShell setup flow for Windows developer machines - #93

Open
AmirMS (AmelBawa-msft) wants to merge 19 commits into
mainfrom
user/amelbawa/dev-config-2
Open

Add a resumable PowerShell setup flow for Windows developer machines#93
AmirMS (AmelBawa-msft) wants to merge 19 commits into
mainfrom
user/amelbawa/dev-config-2

Conversation

@AmelBawa-msft

Copy link
Copy Markdown
Collaborator

Introduces a PowerShell implementation of the developer workstation setup that
runs from a single command, checks every change before applying it, and continues
across the reboot WSL requires.

@AmelBawa-msft
AmirMS (AmelBawa-msft) marked this pull request as ready for review August 19, 2026 17:04
@JohnMcPMS
JohnMcPMS requested a balanced review from CopilotAugust 20, 2026 17:20

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Replaces the DSC-based Calm OS flow with a modular, idempotent PowerShell setup that supports elevation and reboot resumption.

Changes:

  • Adds bootstrap, orchestration, setup phases, and shared helpers.
  • Adds WSL reboot/resume, package, registry, Terminal, font, and Copilot configuration.
  • Updates manifests and documentation while removing the old DSC implementation.

Reviewed changes

Copilot reviewed 32 out of 33 changed files in this pull request and generated 10 comments.

Show a summary per file
FileDescription
.gitignoreIgnores setup tally state.
README.mdDocuments the new PowerShell flow.
src/docs/development.mdDescribes PowerShell-native flow conventions.
src/future/cmdpal/README.mdNotes extension launch limitations.
src/manifest.ymlPoints Calm OS at the new entry script.
src/tests/calm-os/probe.ps1Updates smoke-test commentary.
src/windows-dev-config/README.mdRewrites usage and configuration documentation.
src/windows-dev-config/bootstrap.ps1Downloads and verifies the setup payload.
src/windows-dev-config/dev-config.ps1Orchestrates setup phases and reporting.
src/windows-dev-config/dev-config.wingetRemoves the legacy DSC configuration.
src/windows-dev-config/install.ps1Removes the legacy install shim.
steps/_console.ps1Adds logging and pause helpers.
steps/_elevation.ps1Adds elevation and single-instance handling.
steps/_environment.ps1Adds process, PATH, TLS, and file helpers.
steps/_pwsh-bootstrap.ps1Bootstraps and relaunches under PowerShell 7.
steps/_reboot-resume.ps1Registers post-reboot continuation.
steps/_registry.ps1Adds registry helpers.
steps/_resume-wrapper.ps1Relays resumed-run output.
steps/_retry.ps1Adds retry handling.
steps/_step-runner.ps1Implements check/apply/verify execution.
steps/_terminal.ps1Manages Terminal settings JSON.
steps/_winget.ps1Manages WinGet front ends and packages.
steps/copilot.ps1Configures Copilot integrations.
steps/edge.ps1Applies Edge policies.
steps/fonts.ps1Installs and configures Cascadia fonts.
steps/packages.ps1Defines the package set.
steps/powershell-profile.ps1Adds Oh My Posh initialization.
steps/prerequisites.ps1Verifies PowerShell and WinGet.
steps/registry-explorer.ps1Applies Explorer settings.
steps/registry-system.ps1Applies system settings.
steps/registry-taskbar-search.ps1Applies taskbar and search settings.
steps/terminal.ps1Configures Terminal defaults and theme.
steps/wsl.ps1Installs WSL, reboots, and installs Ubuntu.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment threadsrc/windows-dev-config/README.md Outdated
Comment threadsrc/docs/development.md
Comment on lines +169 to +178
if ($Script:DevConfigWinGetMode -eq 'Cli') {
$listed = Invoke-DevConfigWingetCli -Arguments @('list', '--id', $Id, '--exact', '--accept-source-agreements')
if ($listed.ExitCode -eq $Script:DevConfigWingetNotFound) {
return $false
}
if ($listed.ExitCode -ne 0) {
throw "winget list $Id failed with exit code $($listed.ExitCode)"
}
# winget list --upgrade-available exits 0 for any installed package, with or without an upgrade.
return $true

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLI mode now matches module mode:

return-not (Test-DevConfigWingetUpgradeAvailable-Id $Id)

The helper runs winget list --upgrade-available and matches the package id. Exit codes are no use here — winget returns 0 either way — and the messages are localized, so the id is the only stable signal.

Checked against real winget on a VM, plus unit tests for the upgrade-available, no-match and failed-query cases.

Comment on lines +64 to +66
# Terminal settings are JSONC, so comments are removed before ConvertFrom-Json.
$clean = [regex]::Replace($raw, '/\*[\s\S]*?\*/', '')
$clean = [regex]::Replace($clean, '(?m)^\s*//.*$', '')
Comment on lines +161 to +164
if ($alreadyDone) {
$Script:DevConfigTally.AlreadyOk++
}
[pscustomobject]@{ Step = $step; AlreadyDone = $alreadyDone }
Comment on lines +81 to +86
try {
[System.IO.Compression.ZipFileExtensions]::ExtractToFile($entry, $dest, $true)
} catch {
# A font the system has already loaded can't be overwritten, and it is the same version.
if (-not (Test-Path $dest)) { throw }
Write-Host ' (keeping the copy already in place)' -ForegroundColor DarkGray
@{ Name = 'BluetoothOff'; KeyPath = 'HKCU\Control Panel\Bluetooth'; ValueName = 'Notification Area Icon'; Value = 0; Description = 'Hide Bluetooth icon in taskbar notification area' }
@{ Name = 'EndTask'; KeyPath = $advanced; ValueName = 'TaskbarEndTask'; Value = 1; Description = 'Enable "End Task" on right-click of taskbar icons' }
@{ Name = 'WebSearchOff'; KeyPath = 'HKCU\SOFTWARE\Policies\Microsoft\Windows\Explorer'; ValueName = 'DisableSearchBoxSuggestions'; Value = 1; Description = 'Disable web search in Start/Search' }
@{ Name = 'SearchHightlightOff'; KeyPath = 'HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\SearchSettings'; ValueName = 'IsDynamicSearchBoxEnabled'; Value = 0; Description = 'Disable Show search highlights' }
| - | ------------ | ---------------- |
| 1 | A UAC prompt appears | **Accept it.** Most of the settings are machine-wide and need Administrator. |
| 2 | PowerShell 7 is installed if it isn't already, and the setup restarts itself on it | None |
| 3 | Ten phases run: packages, Windows settings, fonts, Terminal, prompt, Copilot | None. Long silent stretches during big downloads are normal — a "still working" note prints every minute |
Comment on lines +85 to +86
if (Test-Path -LiteralPath $Path) {
Copy-Item -LiteralPath $Path -Destination "$Path.bak" -Force
Comment on lines +37 to +39
# The current WSL package supports --version; the inbox WSL returns a nonzero exit code.
function Test-DevConfigWslPlatformActive {
return ((Get-DevConfigWslExitCode -Arguments @('--version')) -eq 0)
}

$steps += New-DevConfigStep -Name 'PowerToysAOT' -Description 'Turn off PowerToys always-on-top notifications' `
-Check { Test-DevConfigRegistryValue -KeyPath 'HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\PowerToys' -ValueName 'Enabled' -Value 0 } `

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on trying this out, I think this should be Microsoft.PowerToysWin32

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@AmelBawa-msft@manodasanW