Skip to content

Assert the PowerShell floor install.ps1 already documents - #704

Merged
MongLong0214 merged 1 commit into
mainfrom
fix-703-ps51-floor
Aug 16, 2026
Merged

Assert the PowerShell floor install.ps1 already documents#704
MongLong0214 merged 1 commit into
mainfrom
fix-703-ps51-floor

Conversation

@MongLong0214

Copy link
Copy Markdown
Owner

Closes #703.

install.ps1:44 already says it:

Windows PowerShell 5.1 and PowerShell 7+ both run this. Nothing here uses the
ternary operator, null-coalescing, or any other 7-only syntax.

Measured, and true today — ??, ?., &&/||, ternary, -Parallel,
-AsHashtable: zero each. Nothing enforces it.

The intent is written where a reader looks and the enforcement is nowhere. Same
shape as everything else found here this week.

Why this floor is worth asserting rather than discovering

PowerShell parses the whole file before executing any of it. A single ?? fails
at parse time, so the installer's own diagnostics never run — a 5.1 user would
not see Node.js 22.23.2 or newer is required or Nothing was installed. They
would see a syntax error from a file they did not write, about a version nobody
told them they needed.

CI does run install.ps1 under both powershell.exe and pwsh. That proves it
works on a day someone maintains those jobs. This proves it on the day someone
writes ??.

Details

Comments are excluded from the scan, so the file can keep naming these
constructs while explaining why it avoids them — which is what line 45 does. The
second assertion pins that the file still states the floor in prose, because a
contributor who does not know 5.1 is supported cannot keep it.

Verified by injection:

$x = $a ?? $b                                  → 1 failed
$y = ($a) ? 1 : 2                              → 1 failed
Get-Item | ForEach-Object -Parallel { $_ }     → 1 failed
restored                                       → 7 passed

Test-only; no code, no artifact change.

install.ps1 says at line 44 that Windows PowerShell 5.1 and 7+ both run it and
that nothing uses 7-only syntax. That is true today -- no null-coalescing, no
ternary, no pipeline chains, no -Parallel -- and nothing enforces it.

Which is the shape found repeatedly in this repository this week: the intent is
written where a reader looks and the enforcement is somewhere else, or nowhere.

The failure it protects against is worse than an ordinary one. PowerShell parses
the whole file before executing any of it, so a single `??` fails before the
installer's own diagnostics can run. A 5.1 user would not see "Node.js 22.23.2
or newer is required" or "Nothing was installed" -- they would see a syntax
error from a file they did not write, about a version nobody told them they
needed.

CI does run install.ps1 under both powershell.exe and pwsh, and that proves it
works on a day someone maintains those jobs. This proves it on the day someone
writes `??`.

Comments are excluded from the scan so the file can keep naming these
constructs while explaining why it avoids them -- which is exactly what line 45
does.

Verified by injecting each construct: three injections, three failures, and the
restored file green.

Limit: a documented floor is enforced, or it is a preference
Blast: local
Undo: easy
Certainty: firm
Provenance: authored
Record-Id: r-703ps51
@github-actions

Copy link
Copy Markdown

CommitLore — record lint

Trailers: clean — 1 commit in origin/main..715fbc01ff1ae03cf27b6b1d155239bfe23cc4ea
Active constraints: not read — commitlore: the index is incomplete: the build stopped after its time budget with 742 commit(s) or note(s) unread — records in them are missing from this answer. fix: commitlore init (or commitlore index) to finish the index (1 changed path)

Trailer violations fail this check. Active constraints are informational — they are what the repository already decided, not a verdict on this PR.

@MongLong0214
MongLong0214 merged commit 4871432 into main Aug 16, 2026
12 checks passed
Sign up for free to 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.

install.ps1 supports PowerShell 5.1 by accident, not by assertion

1 participant