From 915cb891a9c59acd5b225e2dde2a9ef179dc8f83 Mon Sep 17 00:00:00 2001 From: Sam Coe Date: Tue, 13 Oct 2020 23:07:01 +0200 Subject: [PATCH] Select first browser_download_url from array --- images/win/scripts/Installers/Install-GitHub-CLI.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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