[Windows] Install the latest available azure-cli msi package (#4242)

This commit is contained in:
Mikhail Timofeev
2021-10-09 16:51:33 +03:00
committed by GitHub
parent 2913bd7060
commit cf96490586

View File

@@ -4,10 +4,8 @@
################################################################################
Write-Host "Install the latest Azure CLI release"
$assets = Invoke-RestMethod -Uri 'https://api.github.com/repos/Azure/azure-cli/releases/latest'
$azCliUrl = $assets.assets.browser_download_url
$azCliName = [IO.Path]::GetFileName($azCliUrl)
Install-Binary -Url $azCliUrl -Name $azCliName -ArgumentList ("/qn", "/norestart")
$azCliUrl = "https://aka.ms/installazurecliwindows"
Install-Binary -Url $azCliUrl -Name "azure-cli.msi" -ArgumentList ("/qn", "/norestart")
$azureCliExtensionPath = Join-Path $Env:CommonProgramFiles 'AzureCliExtensionDirectory'
$null = New-Item -ItemType "Directory" -Path $azureCliExtensionPath