Skip to content

Instantly share code, notes, and snippets.

@adotcoop
Created August 24, 2021 12:04
Show Gist options
  • Save adotcoop/c56bc8f495caf26f57180a1f40bc675e to your computer and use it in GitHub Desktop.
Save adotcoop/c56bc8f495caf26f57180a1f40bc675e to your computer and use it in GitHub Desktop.
# Get latest download URI for LTR and latest version of QGIS
# parses the website configuration from github, not scraping the html so should be a bit more reliable
$uri = "https://raw.githubusercontent.com/qgis/QGIS-Website/master/source/schedule.py"
$Content = (Invoke-WebRequest -UseBasicParsing -Uri $uri).Content
try {
$StringData = [RegEx]::Matches($Content, ".*=.*")
$Details = $StringData -Replace ("'", "") | ConvertFrom-StringData
}
catch {
Throw "Failed to extract the version information from downloaded file."
}
$downloadltr = "https://qgis.org/downloads/QGIS-OSGeo4W-$($Details.ltrrelease)-$($Details.ltrbinary).msi"
$downloadlatest = "https://qgis.org/downloads/QGIS-OSGeo4W-$($Details.release)-$($Details.msibinary).msi"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment