diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 9acc9401e..d66377b1a 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -240,3 +240,19 @@ jobs: Write-Host "::error::install.ps1 installed a 0x$machine binary on this runner, expected 0x$env:PE_MACHINE" exit 1 } + + # The documented one-liner, which binds params differently from the + # scriptblock form above. It takes no flags, so it installs the + # latest stable release to the default location. + - name: install.ps1 via irm | iex (Windows PowerShell 5.1) + if: runner.os == 'Windows' + shell: powershell + run: | + irm "$env:RAW_BASE/install.ps1" | iex + $exe = Join-Path $env:USERPROFILE '.local\bin\q2.exe' + $raw = & $exe --version + Write-Host $raw + if ($LASTEXITCODE -ne 0 -or -not $raw) { + Write-Host "::error::q2.exe from the irm | iex install did not run" + exit 1 + } diff --git a/install.ps1 b/install.ps1 index 47c788b58..d3cfb5bc6 100644 --- a/install.ps1 +++ b/install.ps1 @@ -42,7 +42,7 @@ param( [string]$Checksum, [switch]$NoVerify, [switch]$Nightly, - [ValidateSet('windows_amd64', 'windows_arm64')] + # No [ValidateSet]: under `irm | iex` it rejects the empty default. [string]$Platform ) @@ -56,6 +56,10 @@ $UA = @{ 'User-Agent' = 'q2-install' } function Die([string]$msg) { throw "q2 install: $msg" } function Step([string]$msg) { Write-Host "-> $msg" } +if ($Platform -and $Platform -notin @('windows_amd64', 'windows_arm64')) { + Die "unknown -Platform '$Platform' (expected windows_amd64 or windows_arm64)" +} + if (-not [System.Environment]::Is64BitOperatingSystem) { Die 'only 64-bit Windows is supported' }