Update MongoDB and PostgreSQL documentation (#993)
* update mongodb and postgresql md * update pg service
This commit is contained in:
@@ -1,22 +1,19 @@
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
Import-Module -Name ImageHelpers
|
||||
|
||||
#Define user and password for PostgreSQL database
|
||||
$postgresusr="postgres"
|
||||
$postgrespwd="root"
|
||||
$pgUser = "postgres"
|
||||
$pgPwd = "root"
|
||||
|
||||
#Prepare environment variable for validation
|
||||
Set-SystemVariable -SystemVariable PGUSER -Value $postgresusr
|
||||
Set-SystemVariable -SystemVariable PGPASSWORD -Value $postgrespwd
|
||||
#Install latest PostgreSQL
|
||||
Set-SystemVariable -SystemVariable PGUSER -Value $pgUser
|
||||
Set-SystemVariable -SystemVariable PGPASSWORD -Value $pgPwd
|
||||
|
||||
cinst postgresql --params "/Password:$postgrespwd" --params-global --debug --verbose
|
||||
#Install latest PostgreSQL
|
||||
Choco-Install -PackageName postgresql -ArgumentList "--params", "/Password:$pgPwd", "--params-global", "--debug", "--verbose"
|
||||
|
||||
#Get Path to pg_ctl.exe
|
||||
$paths = (Get-CimInstance Win32_Service -Filter "Name LIKE 'postgresql-%'").PathName
|
||||
$pgPath = (Get-CimInstance Win32_Service -Filter "Name LIKE 'postgresql-%'").PathName
|
||||
#Parse output of command above to obtain pure path
|
||||
$pgbin = $paths.split('"')[1].replace("\pg_ctl.exe", "")
|
||||
#Added PostgreSQL bin path into PATH variable.
|
||||
Add-MachinePathItem $pgbin
|
||||
|
||||
$pgBin = Split-Path -Path $pgPath.split('"')[1]
|
||||
#Added PostgreSQL bin path into PATH variable
|
||||
Add-MachinePathItem $pgBin
|
||||
|
||||
Reference in New Issue
Block a user