{CI} enforce WinPS 5.1 AutoGen module validation and failure propagation
Summary
This change hardens AutoGen module validation in CI so Windows PowerShell 5.1 parse/import issues are detected reliably and fail the job when appropriate.
Problem
A previous issue with non-ASCII operator characters passed CI even though it failed in Windows PowerShell 5.1. The pipeline behavior allowed gaps where validation steps could still run incorrectly or not propagate failure clearly.
What changed
- Added/kept explicit WinPS 5.1 AutoGen validation in test flow on Windows agents.
- Used an explicit Windows PowerShell 5.1 executable path:
- powershell.exe
- Updated step conditions to include succeeded() so these validations do not bypass earlier failures.
- Replaced separator detection logic with System.IO.Path.PathSeparator for WinPS compatibility.
- Removed continueOnError on the WinPS AutoGen validation step so failures are not tolerated.
- Captured and checked WinPS process exit code in pipeline script and throw on non-zero to propagate failure.
Why this is safe
- Scope is limited to CI test orchestration.
- No product cmdlet/runtime behavior changes.
- Behavior is stricter only for the intended validation path.
Validation
- Branch includes reviewer-requested fixes for:
- condition handling
- path separator handling in WinPS
- failure propagation from WinPS child process
- Expected outcome: parse/import failures in WinPS 5.1 fail CI deterministically.
Notes
- Experimental test file was removed from the PR branch.
- PR history was squashed/cleaned before final updates.
If you want, I can also give you a shorter version in the exact Azure PowerShell PR template style.
Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
@copilot apply changes based on the comments in this thread
/azp run
Azure Pipelines successfully started running 3 pipeline(s).