Skip to content

Instantly share code, notes, and snippets.

@rewida17
Forked from lukechilds/get_latest_release.sh
Last active August 31, 2020 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rewida17/754c2636154a05c8a32bb76ef6609f4d to your computer and use it in GitHub Desktop.
Save rewida17/754c2636154a05c8a32bb76ef6609f4d to your computer and use it in GitHub Desktop.
PowerShell - Get latest release zip from GitHub
$name="creator/project"
$uri="$(Invoke-WebRequest -Method Get "https://api.github.com/repos/$name/releases/latest" | ConvertFrom-Json | Select-Object -ExpandProperty zipball_url)"
Invoke-RestMethod -Method Get -Uri $uri -OutFile last.zip
Expand-Archive -Path last.zip -DestinationPath $targetDir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment