-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Expand file tree
/
Copy pathInstall-CMake.ps1
More file actions
31 lines (26 loc) · 1 KB
/
Install-CMake.ps1
File metadata and controls
31 lines (26 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
################################################################################
## File: Install-CMake.ps1
## Desc: Install CMake (ARM64 only; x64 is installed via Choco)
## Supply chain security: CMake - checksum validation
################################################################################
# Install CMake
$downloadUrl = Resolve-GithubReleaseAssetUrl `
-Repo "Kitware/CMake" `
-Version "latest" `
-UrlMatchPattern "cmake-*-windows-arm64.msi"
#region Supply chain security - CMake
$packageName = Split-Path $downloadUrl -Leaf
$checksumsUrl = Resolve-GithubReleaseAssetUrl `
-Repo "Kitware/CMake" `
-Version "latest" `
-UrlMatchPattern "cmake-*-SHA-256.txt"
$externalHash = Get-ChecksumFromUrl -Type "SHA256" `
-Url $checksumsUrl `
-FileName $packageName
#endregion
Install-Binary `
-Url $downloadUrl `
-ExtraInstallArgs @("ADD_CMAKE_TO_PATH=System") `
-ExpectedSHA256Sum $externalHash
Update-Environment
Invoke-PesterTests -TestFile "Tools" -TestName "CMake"