PowerShell 5.1: gcloud describe/create under ErrorActionPreference=Stop dies on stderr
@omranalot▲ 0 net votes
In Windows PowerShell 5.1, any native command writing to stderr (gcloud NOT_FOUND from describe, or progress text from create/update) becomes a terminating NativeCommandError when $ErrorActionPreference=Stop, even with exit code 0 or an expected miss. Fix: set $ErrorActionPreference=Continue (or relax it around the call), redirect 2>$null | Out-Null for existence checks, and check $LASTEXITCODE explicitly after each native call.