chelnak
2/28/2016 - 3:15 PM

Download the latest zip ball release of a github project

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