Skip to content

Latest commit

 

History

History
57 lines (40 loc) · 3.58 KB

File metadata and controls

57 lines (40 loc) · 3.58 KB

← Back to Backlog

[SC-024] ✅ DONE - Maintain PowerShell 5.1 compatibility and fix batch wrapper violations

Status: Done (2026-03-18) Priority: Medium Component: Project-wide

Summary: As a user bootstrapping a fresh Windows machine, I need all scripts to run under PowerShell 5.1 (the inbox Windows PowerShell) so that I can use this toolkit without installing PowerShell 7 first.

Description:

Decision: Keep PowerShell 5.1 as the minimum version

After researching the PowerShell community's stance and Microsoft's support lifecycle, the decision is to keep PowerShell 5.1 as the compatibility floor. Key reasons:

1. Bootstrapping requires inbox PowerShell

This is a setup/bootstrapping toolkit. PowerShell 7 (pwsh) is installed via Scoop, which is itself installed by these scripts. Requiring PS 7 to run the installer that installs PS 7 is a chicken-and-egg problem. The batch wrappers must invoke powershell.exe (5.1), not pwsh.exe (7+).

2. PowerShell 5.1 has no independent EOL

PS 5.1's lifecycle is tied to the Windows versions that ship it. Windows Server 2022 (ships with PS 5.1) is supported until October 2031. Windows 11 24H2 ships with PS 5.1 as well. It is not going away any time soon.

3. PS 7 is not shipped inbox with Windows

Despite an active community discussion, Microsoft has not shipped PS 7 as a built-in Windows component. Users must install it separately.

4. Community consensus supports dual compatibility

The PowerShell community broadly recommends supporting both 5.1 and 7.x when targeting Windows environments, especially for tooling that runs on machines where PS 7 may not be present. See:

5. Low maintenance cost

The codebase is already 5.1-compatible. The only version-specific handling needed so far is $PSStyle detection in testrunner.ps1 and PSCustomObject output format in SC-006.

Batch wrapper violations

Several .bat wrappers currently use pwsh instead of powershell, which breaks on machines where PowerShell 7 is not yet installed:

File Current Required
.claude/skills/powershell-wrapper-creator/assets/wrapper-template.bat pwsh powershell
tools/flow-launcher/configure-program-plugin.bat pwsh powershell
tools/flow-launcher/install-flow-launcher.bat pwsh powershell
tools/claude-code/install-claude-code.bat pwsh powershell

The wrapper template is the root cause — it generates new wrappers with pwsh. Fixing the template prevents future violations.

Acceptance Criteria:

  • All .bat wrappers invoke powershell -ExecutionPolicy Bypass, not pwsh
  • The wrapper template in .claude/skills/powershell-wrapper-creator/assets/wrapper-template.bat uses powershell
  • No .bat file in the repository references pwsh
  • All PowerShell scripts use only 5.1-compatible syntax (no PS 6.0+ exclusive features)
  • CI matrix continues to test on both PowerShell 5.1 and 7.x
  • development-principles.md remains the canonical reference for the PS 5.1 compatibility rule

← Back to Backlog