Skip to content

Instantly share code, notes, and snippets.

@Seddryck
Created October 12, 2019 21:08
Show Gist options
  • Save Seddryck/c2fad2d586883d35996c2d2326c6e958 to your computer and use it in GitHub Desktop.
Save Seddryck/c2fad2d586883d35996c2d2326c6e958 to your computer and use it in GitHub Desktop.
Download the latest version of Genbi.exe from GitHub releases
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