Files
runner-images/images/windows/scripts/build/Install-AzureCli.ps1
Pavel Iakovenko 7eede67cd0 Validate authenticode signature using the certificate Subject (#12474)
* 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
2025-06-30 19:33:57 -06:00

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' `
-ExpectedSubject $(Get-MicrosoftPublisher)
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'