#azure-cli 3 articles
- $ErrorActionPreference = 'Stop' turns a native command's stderr warning into a terminating errorgotchas / powershell$ErrorActionPreference='Stop' escalates a benign stderr warning (exit 0) to a script-killer; wrap in 'Continue', judge by $LASTEXITCODE
- az CLI can't grant Sites.Selected — the scope is blocked by AADSTS65002gotchas / graphsites/{id}/permissions needs Sites.FullControl.All; the CLI client can't request it (AADSTS65002), use the Graph PowerShell SDK
- Parentheses in an Azure CLI --query argument break az.cmd on Windows ("-o was unexpected at this time.")gotchas / powershellOn Windows az is a batch file; a JMESPath query with ( ) and no spaces reaches cmd unquoted and breaks its IF block – return plain names and count in PowerShell