Merge pull request #1767 from samcoe/patch-1

[Windows] Update gh install script to use official release assets
This commit is contained in:
Maxim Lobanov
2020-10-19 18:35:51 +03:00
committed by GitHub

View File

@@ -3,8 +3,14 @@
## Desc: Install GitHub CLI
################################################################################
Choco-Install -PackageName gh
Write-Host "Get the latest gh version..."
$Name = "gh_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
Add-MachinePathItem "C:\Program Files (x86)\GitHub CLI"
Invoke-PesterTests -TestFile "CLI.Tools" -TestName "GitHub CLI"
Invoke-PesterTests -TestFile "CLI.Tools" -TestName "GitHub CLI"