| $erroractionpreference = "stop" | |
| $version = "1.20.0" | |
| $sha256sum = "E212EBFB4E8AFB57ADC103A2579C52673A3CA49610FBC2A5EAE643D3D378548D" | |
| $filename = "ispc-v$version-windows" | |
| $tarball = "$filename.zip" | |
| $outdir = $pwd.Path | |
| $outdir = "$outdir\.gitlab" | |
| $ProgressPreference = 'SilentlyContinue' | |
| Invoke-WebRequest -Uri "https://github.com/ispc/ispc/releases/download/v$version/$tarball" -OutFile "$outdir\$tarball" | |
| $hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256 | |
| if ($hash.Hash -ne $sha256sum) { | |
| exit 1 | |
| } | |
| Add-Type -AssemblyName System.IO.Compression.FileSystem | |
| [System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$tarball", "$outdir") | |
| Move-Item -Path "$outdir\$filename" -Destination "$outdir\ispc" | |
| Remove-Item "$outdir\$tarball" |