# spwn installer for Windows — https://spwn.stream # Usage: irm https://spwn.stream/install.ps1 | iex $ErrorActionPreference = "Stop" $Server = "https://spwn.stream" if ($env:SPWN_SERVER) { $Server = $env:SPWN_SERVER } # amd64 everywhere except ARM64 Windows $arch = "amd64" if ($env:PROCESSOR_ARCHITECTURE -eq "ARM64") { $arch = "arm64" } $dest = Join-Path $env:LOCALAPPDATA "Programs\spwn" New-Item -ItemType Directory -Force -Path $dest | Out-Null $url = "$Server/dist/windows/$arch/spwn-windows-$arch.exe" Write-Host "spwn: downloading $url" $exe = Join-Path $dest "spwn.exe" Invoke-WebRequest -Uri $url -OutFile $exe -UseBasicParsing # Make sure the user PATH carries it (no admin rights needed). $userPath = [Environment]::GetEnvironmentVariable("Path", "User") if (($userPath -split ";") -notcontains $dest) { [Environment]::SetEnvironmentVariable("Path", "$userPath;$dest", "User") Write-Host "spwn: added $dest to your user PATH — restart your terminal to pick it up" } & $exe version Write-Host "spwn: installed — pipe something: long-command | spwn"