File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
images/win/scripts/Installers Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 11# ###############################################################################
22# # File: Install-Stack.ps1
33# # Desc: Install Stack for Windows
4+ # # Supply chain security: Stack - checksum validation
45# ###############################################################################
56
67Write-Host " Get the latest Stack version..."
@@ -14,6 +15,13 @@ $StackToolcachePath = Join-Path $Env:AGENT_TOOLSDIRECTORY "stack\$Version"
1415$DestinationPath = Join-Path $StackToolcachePath " x64"
1516$StackArchivePath = Start-DownloadWithRetry - Url $DownloadUrl
1617
18+ # region Supply chain security - Stack
19+ $fileHash = (Get-FileHash - Path $StackArchivePath - Algorithm SHA256).Hash
20+ $hashUrl = $StackReleasesJson.assets | Where-Object { $_.name.EndsWith (" $DownloadFilePattern .sha256" ) } | Select-Object - ExpandProperty " browser_download_url" - First 1
21+ $externalHash = (Invoke-RestMethod - Uri $hashURL ).ToString().Split(" `n " ).Where ({ $_ -ilike " *$DownloadFilePattern *" }).Split(' ' )[0 ]
22+ Use-ChecksumComparison $fileHash $externalHash
23+ # endregion
24+
1725Write-Host " Expand stack archive"
1826Extract- 7Zip - Path $StackArchivePath - DestinationPath $DestinationPath
1927
You can’t perform that action at this time.
0 commit comments