mirror of
https://github.com/actions/runner-images.git
synced 2025-12-31 06:18:24 +08:00
* Use Resolve-GithubReleaseAssetUrl more widely * Add the Get-ChecksumFromUrl function * Sort exported functions and add docs * Remove alias and fix typo * Fix kind checksum url and syntax * Fix checksums url for gh cli and msys2 * [Windows] Cleanup various scripts * Add spaces after type specifications * Rename the Take-Part function
27 lines
1.1 KiB
PowerShell
27 lines
1.1 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
|
|
$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
|