Files
runner-images-sangeeth/images/win/scripts/Installers/Validate-PostgreSQL.ps1
Darii Nurgaleev 64f438fd7a PostgreSQL: Validation and Installer parameters fix. (#1148)
* Removed PostgreSQL server from path.
2020-06-30 20:43:47 +03:00

19 lines
518 B
PowerShell

$pgReadyPath = Join-Path ${env:PGBIN} "pg_isready.exe"
$pgReady = Start-Process -FilePath $pgReadyPath -Wait -PassThru
$exitCode = $pgReady.ExitCode
if ($exitCode -eq 0)
{
Write-Host -Object "PostgreSQL has been successfully installed."
}
else
{
Write-Host -Object "PostgreSQL is not ready. Exitcode: $exitCode"
exit $exitCode
}
#Stop and disable PostgreSQL service
$pgService = Get-Service -Name postgresql*
Stop-Service -InputObject $pgService
Set-Service -InputObject $pgService -StartupType Disabled