mirror of
https://github.com/actions/runner-images.git
synced 2025-12-13 12:48:18 +00:00
* Fix azcli,cosmosdb and remove vscomponent * Update visual studio signature * revert toolset-2022.json changes
30 lines
1.1 KiB
PowerShell
30 lines
1.1 KiB
PowerShell
################################################################################
|
|
## File: Install-AzureCli.ps1
|
|
## Desc: Install and warm-up Azure CLI
|
|
################################################################################
|
|
|
|
Write-Host 'Install the latest Azure CLI release'
|
|
|
|
$azureCliConfigPath = 'C:\azureCli'
|
|
# Store azure-cli cache outside of the provisioning user's profile
|
|
[Environment]::SetEnvironmentVariable('AZURE_CONFIG_DIR', $azureCliConfigPath, "Machine")
|
|
|
|
$azureCliExtensionPath = Join-Path $env:CommonProgramFiles 'AzureCliExtensionDirectory'
|
|
New-Item -ItemType 'Directory' -Path $azureCliExtensionPath | Out-Null
|
|
[Environment]::SetEnvironmentVariable('AZURE_EXTENSION_DIR', $azureCliExtensionPath, "Machine")
|
|
|
|
Install-Binary -Type MSI `
|
|
-Url 'https://aka.ms/installazurecliwindowsx64' `
|
|
-ExpectedSignature '8F985BE8FD256085C90A95D3C74580511A1DB975'
|
|
|
|
Update-Environment
|
|
|
|
# Warm-up Azure CLI
|
|
Write-Host "Warmup 'az'"
|
|
az --help | Out-Null
|
|
if ($LASTEXITCODE -ne 0) {
|
|
throw "Command 'az --help' failed"
|
|
}
|
|
|
|
Invoke-PesterTests -TestFile 'CLI.Tools' -TestName 'Azure CLI'
|