$erroractionpreference = "stop" $version = "3.19.3" $sha256sum = "3838E11A0DB08F97D687F061882A1E52807010A313F3AC716015B3587CA3F20E" $filename = "cmake-$version-win64-x64" $tarball = "$filename.zip" $outdir = $pwd.Path $outdir = "$outdir\.gitlab" $ProgressPreference = 'SilentlyContinue' Invoke-WebRequest -Uri "https://github.com/Kitware/CMake/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\cmake"