azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

{CI} enforce WinPS 5.1 AutoGen module validation and failure propagation

Open YangAn-microsoft opened this issue 6 months ago • 6 comments

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.

YangAn-microsoft avatar May 09 '26 03:05 YangAn-microsoft

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

/azp run

VeryEarly avatar May 11 '26 03:05 VeryEarly

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar May 11 '26 03:05 azure-pipelines[bot]

@copilot apply changes based on the comments in this thread

YangAn-microsoft avatar May 12 '26 03:05 YangAn-microsoft

/azp run

YangAn-microsoft avatar May 12 '26 06:05 YangAn-microsoft

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar May 12 '26 06:05 azure-pipelines[bot]