# Belay installer bootstrap (PowerShell 5.1+) $ErrorActionPreference = 'Stop' [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 # Caller arguments (for example -Uninstall or -Help) are bound by name through # a hashtable splat; an array splat would pass them positionally and lose them. $installParams = @{} $pendingName = $null foreach ($item in @($args)) { if ("$item" -match '^-([A-Za-z][A-Za-z0-9]*)$') { $pendingName = $Matches[1] $installParams[$pendingName] = $true } elseif ($null -ne $pendingName) { $installParams[$pendingName] = $item $pendingName = $null } else { throw "belay-install: unexpected argument: $item" } } if (-not ($installParams.ContainsKey('Uninstall') -or $installParams.ContainsKey('Help'))) { $installParams['Quickstart'] = $true } $installParams['AllowUntrusted'] = $true Write-Host 'Belay alpha notice: this Windows build is unsigned, so SmartScreen may warn the first time you run it.' Write-Host 'Choose More info, then Run anyway, for that binary only. Do not turn SmartScreen off.' Write-Host 'The installer still verifies the release checksum and the packaged checksums.' $env:BELAY_VERSION = '0.0.1-alpha.9' $installer = Invoke-RestMethod -Uri 'https://github.com/DoplexLabs/belay/releases/download/v0.0.1-alpha.9/install.ps1' -UseBasicParsing & ([scriptblock]::Create($installer)) @installParams