[Windows] Add signature validation (#8390)

This commit is contained in:
sergei-pyshnoi
2023-10-11 11:02:59 +02:00
committed by GitHub
parent 47a634e28b
commit 6315b7ed2c
26 changed files with 122 additions and 59 deletions

View File

@@ -17,8 +17,11 @@ if ($userPath) {
$env:Path = $systemPath
}
# Run the installer
Invoke-Expression ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
# Verify and run choco installer
$signatureThumbprint = "83AC7D88C66CB8680BCE802E0F0F5C179722764B"
$InstallScriptPath = Start-DownloadWithRetry -Url 'https://chocolatey.org/install.ps1'
Test-FileSignature -FilePath $InstallScriptPath -ExpectedThumbprint $signatureThumbprint
Invoke-Expression $InstallScriptPath
# Turn off confirmation
choco feature enable -n allowGlobalConfirmation