$ErrorActionPreference = 'Stop' $scriptUrl = 'https://gitlab.com/comluojian/agent-tools/-/raw/main/codex/windows/vscode/latest/Run-CodexPluginSetup.ps1' $scriptPath = Join-Path ([System.IO.Path]::GetTempPath()) ('CodexPluginSetup-' + [guid]::NewGuid().ToString('N') + '.ps1') try { Invoke-WebRequest -UseBasicParsing -Uri $scriptUrl -OutFile $scriptPath & powershell.exe -NoProfile -ExecutionPolicy Bypass -File $scriptPath if ($LASTEXITCODE -ne 0) { throw "Codex plugin setup failed, exit code: $LASTEXITCODE" } } finally { if (Test-Path -LiteralPath $scriptPath -PathType Leaf) { Remove-Item -LiteralPath $scriptPath -Force } }