Skip to content

prereq-check: az version returns 'unknown' on Windows (PowerShell quoting bug) #130

@arnaudlh

Description

@arnaudlh

Symptom

On Windows (PowerShell), prereq-check reports az as OUTDATED with version unknown, even when a current Azure CLI (e.g. 2.85+) is installed. This blocks Git-Ape onboarding for any user running PowerShell.

Observed in a session diagnosis (Claude Opus 4.6, ~02:21 UTC, 2026-05-27):

Script reported az as OUTDATED/unknown due to a --query argument error. Manual check confirmed az 2.85.0 (well above 2.50 minimum).

Root cause

check-tools.ps1 calls:

az version --query '"azure-cli"' -o tsv

When PowerShell invokes native commands, its argument parser strips the inner double-quotes from '"azure-cli"'. The CLI ends up receiving the JMESPath query azure-cli (without quotes), which is an invalid identifier because of the hyphen — JMESPath rejects it as a parse error, the command writes nothing to stdout, and the script falls back to the literal string unknown.

The sibling check-tools.sh does not have this problem because POSIX shells preserve the inner quotes.

Repro

On Windows with PowerShell 7.x:

pwsh -NoProfile -File .github/skills/prereq-check/scripts/check-tools.ps1

Expected: az\tOK\t<version>\t2.50
Actual: az\tOUTDATED\tunknown\t2.50

Proposed fix

Replace the JMESPath query with -o json | ConvertFrom-Json and access the azure-cli property natively — sidesteps the PowerShell native-command quoting issue entirely. PR incoming.

Files

  • .github/skills/prereq-check/scripts/check-tools.ps1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions