mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 13:17:54 +00:00
* Use cerificate subject to verify authenticode signature * Use function instead of script variables * Switch all places to using Get-MicrosoftPublisher * Remove SignatureThumbprint * Use common subject for the Edge driver
26 lines
1.0 KiB
PowerShell
26 lines
1.0 KiB
PowerShell
################################################################################
|
|
## 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
|
|
Add-MachinePathItem 'C:\ProgramData\Chocolatey\bin'
|
|
Update-Environment
|
|
|
|
# Verify and run choco installer
|
|
$installScriptPath = Invoke-DownloadWithRetry 'https://chocolatey.org/install.ps1'
|
|
Test-FileSignature -Path $installScriptPath -ExpectedSubject 'CN="Chocolatey Software, Inc", O="Chocolatey Software, Inc", L=Topeka, S=Kansas, C=US'
|
|
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
|