File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,10 +10,11 @@ function Write-Info($msg) { Write-Host "sonar " -ForegroundColor Cyan -NoNewline
1010function Write-Ok ($msg ) { Write-Host " OK " - ForegroundColor Green - NoNewline; Write-Host $msg }
1111function Write-Err ($msg ) { Write-Host " ERR " - ForegroundColor Red - NoNewline; Write-Host $msg ; exit 1 }
1212
13- # Detect architecture
14- $Arch = switch ([System.Runtime.InteropServices.RuntimeInformation ]::OSArchitecture) {
15- " X64" { " amd64" }
16- " Arm64" { " arm64" }
13+ # Detect architecture ($env:PROCESSOR_ARCHITECTURE works on PowerShell 5.x;
14+ # RuntimeInformation is unavailable there and crashes the script)
15+ $Arch = switch ($env: PROCESSOR_ARCHITECTURE ) {
16+ " AMD64" { " amd64" }
17+ " ARM64" { " arm64" }
1718 default { Write-Err " Unsupported architecture: $_ " }
1819}
1920
You can’t perform that action at this time.
0 commit comments