Files
steamify-cachyos-dev/get-iso.ps1
T
theupriser 97c5c569c8 fix: Add CachyOS test VM dev environment and VM testing skill
QEMU/KVM scripts for a CachyOS KDE test VM (run.sh/run.ps1, get-iso,
guest SSH setup), host helper scripts to drive and inspect the
cachyos-gamescope-boot wizard in the guest, and a Claude Code skill
documenting the test workflow.
2026-09-23 15:14:17 +02:00

29 lines
1.3 KiB
PowerShell

# Download the latest CachyOS desktop ISO to cachyos.iso and verify its checksum.
# Windows version of get-iso.sh; re-running resumes a partial download.
$ErrorActionPreference = 'Stop'
Set-Location $PSScriptRoot
$mirror = if ($env:MIRROR) { $env:MIRROR } else { 'https://nl.mirror.cx/cachyos' }
$page = (Invoke-WebRequest -UseBasicParsing https://cachyos.org/download/).Content
$m = [regex]::Match($page, 'ISO/desktop/[0-9]+/cachyos-desktop-linux-[0-9]+\.iso')
if (-not $m.Success) { throw 'Could not find the current ISO on cachyos.org/download' }
$url = "$mirror/$($m.Value)"
$name = Split-Path $m.Value -Leaf
Write-Host "Latest release: $name"
if ((Test-Path cachyos.iso) -and ((Get-Content cachyos.iso.version -ErrorAction SilentlyContinue) -ne $name)) {
Write-Host 'Existing cachyos.iso is an older release, replacing it.'
Remove-Item cachyos.iso
}
# curl.exe ships with Windows 10+ and supports resuming (-C -).
curl.exe -fL -C - -o cachyos.iso $url
if ($LASTEXITCODE -ne 0) { throw 'Download failed' }
Set-Content cachyos.iso.version $name
Write-Host 'Verifying checksum...'
$expected = ((curl.exe -fsL "$url.sha256") -split '\s+')[0]
$actual = (Get-FileHash cachyos.iso -Algorithm SHA256).Hash
if ($actual -ieq $expected) { Write-Host 'cachyos.iso: OK' } else { throw "Checksum mismatch: $actual" }