Skip to content

Instantly share code, notes, and snippets.

@adotcoop
Created June 25, 2021 14:03
Show Gist options
  • Save adotcoop/aa007306be701fcdbe3a6c1c7b280b3c to your computer and use it in GitHub Desktop.
Save adotcoop/aa007306be701fcdbe3a6c1c7b280b3c to your computer and use it in GitHub Desktop.
Get the latest release date and url for the Windows version of PostgreSQL
$postgres = Invoke-WebRequest -UseBasicParsing -uri https://www.postgresql.org/versions.json | ConvertFrom-Json
$LatestVersion = $postgres | Where-Object current -eq "True"
$releaseDate = $LatestVersion.relDate
$url = "https://get.enterprisedb.com/postgresql/postgresql-$($LatestVersion.major).$($LatestVersion.latestMinor)-2-windows-x64.exe"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment