File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
images/win/scripts/Installers Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 11# ###############################################################################
22# # File: Install-Kotlin.ps1
33# # Desc: Install Kotlin
4+ # # Supply chain security: Kotlin - checksum validation
45# ###############################################################################
56
67# Install Kotlin
@@ -10,11 +11,17 @@ $kotlinBinaryName = (Get-ToolsetContent).kotlin.binary_name
1011$kotlinDownloadUrl = Get-GitHubPackageDownloadUrl - RepoOwner " JetBrains" - RepoName " kotlin" - BinaryName $kotlinBinaryName - Version $kotlinVersion - UrlFilter " *{BinaryName}-{Version}.zip"
1112$kotlinInstallerPath = Start-DownloadWithRetry - Url $kotlinDownloadUrl - Name " $kotlinBinaryName .zip"
1213
14+ # region Supply chain security
15+ $fileHash = (Get-FileHash - Path $kotlinInstallerPath - Algorithm SHA256).Hash
16+ $externalHash = Get-HashFromGitHubReleaseBody - RepoOwner " JetBrains" - RepoName " kotlin" - FileName " $kotlinBinaryName " - Version $kotlinVersion - WordNumber 2
17+ Use-ChecksumComparison $fileHash $externalHash
18+ # endregion
19+
1320Write-Host " Expand Kotlin archive"
1421$kotlinPath = " C:\tools"
1522Extract- 7Zip - Path $kotlinInstallerPath - DestinationPath $kotlinPath
1623
1724# Add to PATH
1825Add-MachinePathItem " $kotlinPath \kotlinc\bin"
1926
20- Invoke-PesterTests - TestFile " Tools" - TestName " Kotlin"
27+ Invoke-PesterTests - TestFile " Tools" - TestName " Kotlin"
You can’t perform that action at this time.
0 commit comments