Repository navigation
ci: fix Windows runner setup on PowerShell 5.1 - #742
Merged
Merged
Conversation
foxnne
force-pushed
the
ci/windows-runner-setup-fixes
branch
6 times, most recently
from
October 22, 2026 05:55
e2c0b5b to
1068b67
Compare
foxnne
force-pushed
the
ci/windows-runner-setup-fixes
branch
from
October 22, 2026 05:59
1068b67 to
dba535d
Compare
foxnne
marked this pull request as ready for review
October 22, 2026 08:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #740. The first real run on Windows PowerShell 5.1 failed:
New-LocalUserhas no-UserCannotChangePassword(it is-UserMayNotChangePassword).runner-setup.ps1andrunner-clean.ps1against Windows PowerShell 5.1 from memory of its docs (New/Set/Get-LocalUser, the ScheduledTask cmdlets incl.-LogonType S4U, Invoke-WebRequest/RestMethod, Get-FileHash, Set-ItemProperty, Add-MpPreference, services, Get-Content/Set-Content): no other mismatch found.test-runner-setup.ps1now parses both scripts and fails on pwsh-7-only syntax and on any named parameter outside a 5.1 allowlist for the cmdlets listed there (a table to extend when a script uses a new cmdlet).Verified: nothing was run (no pwsh here); CI runs the new test under pwsh 7. The allowlist is hand-written, so it only catches what it lists.
Second fix: the batch-logon grant now uses LsaAddAccountRights and verifies with LsaEnumerateAccountRights through a small Add-Type (no INF/secedit parsing, which failed on the first real run). Unrun here; the C# compiles only on the box.