#Requires -Version 5.1 Set-StrictMode -Version Latest $ErrorActionPreference = 'Stop' # Shim: delegates to the Python ci_orchestrator CLI. # Original PS implementation moved to git history; see plans/A2-closeout.md. # # Callers (e.g. Measure-CIBenchmark.ps1) may pass PowerShell common # parameters like -ErrorAction SilentlyContinue. Those must NOT be # forwarded as --error-action etc. (the Python CLI rejects them). # Value-taking common params consume the following token too. $commonWithValue = @{ erroraction = $true; warningaction = $true; informationaction = $true progressaction = $true; errorvariable = $true; warningvariable = $true informationvariable = $true; outvariable = $true; outbuffer = $true pipelinevariable = $true } $commonSwitch = @{ verbose = $true; debug = $true; whatif = $true; confirm = $true } $pyArgs = @() for ($i = 0; $i -lt $args.Count; $i++) { $a = $args[$i] if ($a -is [string] -and $a.Length -gt 1 -and $a.StartsWith('-') -and -not $a.StartsWith('--')) { $name = $a.Substring(1) $lname = $name.ToLower() if ($commonSwitch.ContainsKey($lname)) { continue } if ($commonWithValue.ContainsKey($lname)) { $i++; continue } $kebab = [Regex]::Replace($name, '(?<=[a-z0-9])([A-Z])', '-$1') $kebab = [Regex]::Replace($kebab, '([A-Z]+)([A-Z][a-z])', '$1-$2') $pyArgs += '--' + $kebab.ToLower() } else { $pyArgs += $a } } $venvPython = $env:CI_VENV_PYTHON if (-not $venvPython) { $venvPython = 'F:\CI\python\venv\Scripts\python.exe' } & $venvPython -m ci_orchestrator vm remove @pyArgs exit $LASTEXITCODE