Skip to content

Instantly share code, notes, and snippets.

@chelnak
Last active January 25, 2021 23:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chelnak/8614ffb320c20c1219f9 to your computer and use it in GitHub Desktop.
Save chelnak/8614ffb320c20c1219f9 to your computer and use it in GitHub Desktop.
Download the latest zip ball release of a github project
# --- Set the uri for the latest release
$URI = "https://api.github.com/repos/chelnak/vRAAPIClient/releases/latest"
# --- Query the API to get the url of the zip
$Response = Invoke-RestMethod -Method Get -Uri $URI
$ZipUrl = $Response.zipball_url
# --- Download the file to the current location
$OutputPath = "$((Get-Location).Path)\$($Response.name.Replace(" ","_")).zip"
Invoke-RestMethod -Method Get -Uri $ZipUrl -OutFile $OutputPath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment