Skip to content

Instantly share code, notes, and snippets.

@FeodorFitsner
Created March 2, 2016 19:55
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 FeodorFitsner/a2e945e4da9e2f40632b to your computer and use it in GitHub Desktop.
Save FeodorFitsner/a2e945e4da9e2f40632b to your computer and use it in GitHub Desktop.
Install PostgreSQL
Write-Host "Installing PostgreSQL 9.4..." -ForegroundColor Cyan
Write-Host "Downloading..."
# http://www.enterprisedb.com/products-services-training/pgdownload#windows
$exePath = "$($env:USERPROFILE)\postgresql-9.4.5-1-windows-x64.exe"
(New-Object Net.WebClient).DownloadFile('http://get.enterprisedb.com/postgresql/postgresql-9.4.5-1-windows-x64.exe', $exePath)
Write-Host "Installing..."
cmd /c start /wait $exePath --mode unattended --superpassword Password12!
del $exePath
Write-Host "Setting up services..."
Stop-Service postgresql-x64-9.4
Set-Service -Name postgresql-x64-9.4 -StartupType Manual
Write-Host "PostgreSQL 9.4 installed" -ForegroundColor Green
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment