# grokBrain kit: download, verify (SHA-256) and run the installer. # irm https://grokbrain-kit.pages.dev/get.ps1 | iex $ErrorActionPreference = "Stop" $ProgressPreference = "SilentlyContinue" $V = "0.2.0" $Base = if ($env:GROKBRAIN_KIT_BASE) { $env:GROKBRAIN_KIT_BASE } else { "https://grokbrain-kit.pages.dev" } $Dir = if ($env:GROKBRAIN_KIT_DIR) { $env:GROKBRAIN_KIT_DIR } else { Join-Path $env:LOCALAPPDATA "grokBrain-kit" } $Zip = "grokbrain-kit-$V.zip" New-Item -ItemType Directory -Force -Path $Dir | Out-Null $ZipPath = Join-Path $Dir $Zip $SumPath = Join-Path $Dir "SHA256SUMS" Write-Host "Downloading grokBrain kit $V into $Dir" Invoke-WebRequest -UseBasicParsing -Uri "$Base/$Zip" -OutFile $ZipPath Invoke-WebRequest -UseBasicParsing -Uri "$Base/SHA256SUMS" -OutFile $SumPath $want = $null foreach ($line in Get-Content $SumPath) { $parts = $line.Trim() -split "\s+" if ($parts.Count -ge 2 -and $parts[1] -eq $Zip) { $want = $parts[0].ToLower() } } $got = (Get-FileHash -Algorithm SHA256 -Path $ZipPath).Hash.ToLower() if (-not $want -or $want -ne $got) { throw "Checksum mismatch, not installing." } Write-Host "Checksum OK ($got)" $Kit = Join-Path $Dir "grokbrain-kit-$V" if (Test-Path $Kit) { Remove-Item -Recurse -Force $Kit } Expand-Archive -Path $ZipPath -DestinationPath $Dir -Force $exe = if (Get-Command powershell -ErrorAction SilentlyContinue) { "powershell" } else { "pwsh" } & $exe -NoProfile -ExecutionPolicy Bypass -File (Join-Path $Kit "install.ps1")