#!/usr/bin/env bash # The drive-reference class (6 October 2026): in Windows PowerShell 5.1 a double-quoted string holding `$name:` followed # by a character that is not a path separator is parsed as a drive-qualified variable (`$name:rest`), which is a parse # error at script start ("Variable reference is not valid"): the identities job run-ca3-pc1-amd-identities-20261006 # failed in 0 s on `"... under $appDir: nothing posted"`. Rule: write `${name}:` or `$($name):`. This check fails CI on # any .ps1 whose double-quoted strings hold `$name:` where name is not a PowerShell scope or drive (env, script, # global, local, private, using, function, variable, alias, Env). Single-quoted here-strings (@' ... '@) are skipped: # PowerShell never expands them (bash text for WSL lives there, pc2-segments.ps1 line 125, a false positive on 6 October). set -euo pipefail cd "$(dirname "$0")/../.." python3 - <<'PY' import re, subprocess, sys files = subprocess.check_output(['git', 'ls-files', '*.ps1', '**/*.ps1'], text=True).split() ok_names = {'env', 'Env', 'ENV', 'script', 'global', 'local', 'private', 'using', 'function', 'variable', 'alias'} pat = re.compile(r'(?