diff --git a/images/win/scripts/Installers/Install-PostgreSQL.ps1 b/images/win/scripts/Installers/Install-PostgreSQL.ps1 index ee7177c6c..11f5476d4 100644 --- a/images/win/scripts/Installers/Install-PostgreSQL.ps1 +++ b/images/win/scripts/Installers/Install-PostgreSQL.ps1 @@ -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 diff --git a/images/win/scripts/Installers/Validate-PostgreSQL.ps1 b/images/win/scripts/Installers/Validate-PostgreSQL.ps1 index a5eee18f2..739a5fe59 100644 --- a/images/win/scripts/Installers/Validate-PostgreSQL.ps1 +++ b/images/win/scripts/Installers/Validate-PostgreSQL.ps1 @@ -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 diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Databases.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Databases.psm1 index 0e993579e..b95198eb4 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Databases.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Databases.psm1 @@ -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