#Requires -Version 5.1 Set-StrictMode -Version Latest $ErrorActionPreference = 'Stop' # Shim: delegates to the Python ci_orchestrator CLI (`artifacts collect`). # Original PS implementation moved to git history; see plans/A3-closeout.md. # # The bound `-Credential` is intentionally discarded — Python uses keyring # via `--credential-target` (defaulting to `BuildVMGuest`). [CmdletBinding()] param( [Parameter(Mandatory)] [string] $IPAddress, [Parameter()] [System.Management.Automation.PSCredential] $Credential, [Parameter(Mandatory)] [string] $GuestArtifactPath, [Parameter(Mandatory)] [string] $HostArtifactDir, [switch] $IncludeLogs, [ValidateSet('Windows', 'Linux')] [string] $GuestOS = 'Windows', [string] $SshKeyPath = 'F:\CI\keys\ci_linux', [string] $SshUser = 'ci_build', [string] $SshKnownHostsFile = '', [string] $JobId = '', [string] $Commit = '', [string] $CredentialTarget = '' ) $pyArgs = @( '--ip-address', $IPAddress, '--guest-os', $GuestOS.ToLower(), '--guest-artifact-path', $GuestArtifactPath, '--host-artifact-dir', $HostArtifactDir, '--ssh-user', $SshUser, '--ssh-key-path', $SshKeyPath, '--job-id', $JobId, '--commit', $Commit ) if ($SshKnownHostsFile) { $pyArgs += @('--ssh-known-hosts-file', $SshKnownHostsFile) } if ($CredentialTarget) { $pyArgs += @('--credential-target', $CredentialTarget) } if ($IncludeLogs.IsPresent) { $pyArgs += '--include-logs' } if ($Credential) { Write-Host '[Get-BuildArtifacts] -Credential ignored; Python CLI uses keyring (set -CredentialTarget to override target name).' } $venvPython = $env:CI_VENV_PYTHON if (-not $venvPython) { $venvPython = 'F:\CI\python\venv\Scripts\python.exe' } & $venvPython -m ci_orchestrator artifacts collect @pyArgs exit $LASTEXITCODE