Update MongoDB and PostgreSQL documentation (#993)

* update mongodb and postgresql md

* update pg service
This commit is contained in:
Aleksandr Chebotov
2020-06-03 17:35:03 +03:00
committed by GitHub
parent 1810983a57
commit 52e3e704dd
6 changed files with 82 additions and 70 deletions
@@ -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