PostgreSQL: Validation and Installer parameters fix. (#1148)

* Removed PostgreSQL server from path.
This commit is contained in:
Darii Nurgaleev
2020-07-01 00:43:47 +07:00
committed by GitHub
parent e16e7a7e30
commit 64f438fd7a
3 changed files with 4 additions and 3 deletions

View File

@@ -9,7 +9,7 @@ Set-SystemVariable -SystemVariable PGUSER -Value $pgUser
Set-SystemVariable -SystemVariable PGPASSWORD -Value $pgPwd
#Install latest PostgreSQL
Choco-Install -PackageName postgresql -ArgumentList "--params", "/Password:$pgPwd", "/NoPath", "--params-global", "--debug", "--verbose"
Choco-Install -PackageName postgresql -ArgumentList "--params", "'/Password:$pgPwd /NoPath'", "--params-global", "--debug", "--verbose"
#Get Path to pg_ctl.exe
$pgPath = (Get-CimInstance Win32_Service -Filter "Name LIKE 'postgresql-%'").PathName

View File

@@ -1,4 +1,4 @@
$pgReadyPath = Join-Path $PGBIN "pg_isready.exe"
$pgReadyPath = Join-Path ${env:PGBIN} "pg_isready.exe"
$pgReady = Start-Process -FilePath $pgReadyPath -Wait -PassThru
$exitCode = $pgReady.ExitCode

View File

@@ -4,7 +4,8 @@ function Get-PostgreSQLMarkdown
$pgService = Get-CimInstance Win32_Service -Filter "Name LIKE 'postgresql-%'"
$pgPath = $pgService.PathName
$pgRoot = $pgPath.split('"')[1].replace("\bin\pg_ctl.exe", "")
$pgVersion = (pg_config --version).split()[1].Trim()
$env:Path += ";${env:PGBIN}"
$pgVersion = (postgres --version).split()[2].Trim()
$content = [PSCustomObject]@{
Version = $pgVersion
UserName = $env:PGUSER