Skip to content

Instantly share code, notes, and snippets.

@clemmesserli
Created January 13, 2022 23:45
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 clemmesserli/318875e945df14ba779850ba48c98c73 to your computer and use it in GitHub Desktop.
Save clemmesserli/318875e945df14ba779850ba48c98c73 to your computer and use it in GitHub Desktop.
Snippet used to pull down the latest release of an F5 RPM package
$repo = "F5Networks/f5-appsvcs-extension"
$filenamePattern = "*.noarch.rpm"
$releasesUri = "https://api.github.com/repos/$repo/releases/latest"
$downloadUri = ((Invoke-RestMethod -Method GET -Uri $releasesUri).assets | Where-Object name -like $filenamePattern ).browser_download_url
$filePath = Join-Path -Path $([System.IO.Path]::GetTempPath()) -ChildPath $(Split-Path -Path $downloadUri -Leaf)
Invoke-WebRequest -Uri $downloadUri -Out $filePath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment