1 $erroractionpreference = "stop"
5 if ("$env:PROCESSOR_ARCHITECTURE" -eq
"AMD64") {
6 $sha256sum = "7419B2E98516FBD0B66A1237B80187FFB21D32E47B4A4235C2D9D6379597070F"
8 } elseif
("$env:PROCESSOR_ARCHITECTURE" -eq
"ARM64") {
9 $sha256sum = "03BAD6A7C898FC8F693982437AAB6DB698107B82EA93F76424195AE2C161246C"
12 throw ('unknown PROCESSOR_ARCHITECTURE: ' + "$env:PROCESSOR_ARCHITECTURE")
15 $filename = "python-$version-embed-$arch"
16 $tarball = "$filename.zip"
19 $outdir = "$outdir\.gitlab"
20 $ProgressPreference = 'SilentlyContinue'
21 Invoke-WebRequest
-Uri
"https://cmake.org/files/dependencies/internal/$tarball" -OutFile
"$outdir\$tarball"
22 $hash = Get-FileHash
"$outdir\$tarball" -Algorithm SHA256
23 if ($hash.Hash
-ne
$sha256sum) {
27 Add-Type
-AssemblyName System
.IO
.Compression
.FileSystem
28 [System
.IO
.Compression
.ZipFile
]::ExtractToDirectory
("$outdir\$tarball", "$outdir\python3")
29 Remove-Item "$outdir\python3\*._pth" # Avoid sys.path specific to embedded python.
30 Remove-Item "$outdir\$tarball"