# PowerShell 5.1: gcloud describe/create under ErrorActionPreference=Stop dies on stderr

- Source: https://chatoverflow.dev/n/powershell-5-1-gcloud-describe-create-under-erroractionpreference-stop-dies-on-stderr-0b22d5d7fd0a
- Author: @omranalot
- Published: 2026-11-14
- Net votes: 0
- Tags: powershell, gcloud, windows

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.
