diff --git a/images/win/scripts/Installers/Install-GitHub-CLI.ps1 b/images/win/scripts/Installers/Install-GitHub-CLI.ps1 index 6e9a2e624..1efb2f74e 100644 --- a/images/win/scripts/Installers/Install-GitHub-CLI.ps1 +++ b/images/win/scripts/Installers/Install-GitHub-CLI.ps1 @@ -6,7 +6,8 @@ Write-Host "Get the latest gh version..." $Name = "gh_windows_amd64.msi" -$DownloadUrl = (Invoke-RestMethod -Uri "https://api.github.com/repos/cli/cli/releases/latest").assets.browser_download_url -match "windows_amd64.msi" +$Assets = (Invoke-RestMethod -Uri "https://api.github.com/repos/cli/cli/releases/latest").assets +$DownloadUrl = ($Assets.browser_download_url -match "windows_amd64.msi") | Select-Object -First 1 Install-Binary -Url $DownloadUrl -Name $Name