Created
October 12, 2019 21:08
-
-
Save Seddryck/c2fad2d586883d35996c2d2326c6e958 to your computer and use it in GitHub Desktop.
Download the latest version of Genbi.exe from GitHub releases
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
[switch]$pre = $false, | |
[Parameter(Mandatory = $false)] $zipfilePath = 'C:\Projects\genbi.zip' | |
) | |
$latestRelease = Invoke-WebRequest https://api.github.com/repos/seddryck/nbi/releases$(If (!$pre) {"/latest"}) -Headers @{"Accept"="application/json"} | |
$json = $latestRelease.Content | ConvertFrom-Json | |
write-host $json[0] | |
write-host 'latest version:' $json[0].tag_name | |
$url = $json[0].assets | ? { $_.Name -Match "Genbi" } | % browser_download_url | |
write-host 'url:' $url | |
write-host 'destination:' $zipfilePath | |
Invoke-WebRequest -Uri $url -OutFile $zipfilePath |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment