$ErrorActionPreference = "Stop" $BaseUrl = "https://sitebrush.com/download/latest/server-app" $InstallDir = Join-Path $env:ProgramFiles "sitebrush" $Exe = Join-Path $InstallDir "sitebrush.exe" $Architecture = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString() switch ($Architecture) { "X64" { $BinaryArch = "amd64" } "Arm64" { $BinaryArch = "arm64" } default { throw "Unsupported CPU architecture: $Architecture. Supported: x64 and ARM64." } } $Url = "$BaseUrl/sitebrush_windows_$BinaryArch.exe" Write-Host "" Write-Host "SiteBrush universal installer" Write-Host "--------------------------------" Write-Host "Operating system : Windows" Write-Host "Architecture : $BinaryArch" Write-Host "Binary : $Url" Write-Host "" New-Item -ItemType Directory -Force -Path $InstallDir | Out-Null Invoke-WebRequest -UseBasicParsing -Uri $Url -OutFile $Exe Write-Host "" Write-Host "Installed: $Exe" Write-Host "Configuring SiteBrush..." & $Exe -install