Files
runner-images-temp/images/windows/scripts/build/Install-Chocolatey.ps1
T

27 lines
1.1 KiB
PowerShell
Raw Normal View History

################################################################################
## File: Install-Chocolatey.ps1
## Desc: Install Chocolatey package manager
################################################################################
Write-Host "Set TLS1.2"
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor "Tls12"
Write-Host "Install chocolatey"
# Add to system PATH
2023-12-04 10:50:53 +01:00
Add-MachinePathItem 'C:\ProgramData\Chocolatey\bin'
Update-Environment
2023-10-11 11:02:59 +02:00
# Verify and run choco installer
$signatureThumbprint = "83AC7D88C66CB8680BCE802E0F0F5C179722764B"
$installScriptPath = Invoke-DownloadWithRetry 'https://chocolatey.org/install.ps1'
Test-FileSignature -Path $installScriptPath -ExpectedThumbprint $signatureThumbprint
Invoke-Expression $installScriptPath
# Turn off confirmation
choco feature enable -n allowGlobalConfirmation
# Initialize environmental variable ChocolateyToolsLocation by invoking choco Get-ToolsLocation function
Import-Module "$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1" -Force
Get-ToolsLocation