aboutsummaryrefslogtreecommitdiffstats
path: root/coin/provisioning/common/windows/postgresql.ps1
diff options
context:
space:
mode:
Diffstat (limited to 'coin/provisioning/common/windows/postgresql.ps1')
-rw-r--r--coin/provisioning/common/windows/postgresql.ps135
1 files changed, 16 insertions, 19 deletions
diff --git a/coin/provisioning/common/windows/postgresql.ps1 b/coin/provisioning/common/windows/postgresql.ps1
index ca47f078..b9681809 100644
--- a/coin/provisioning/common/windows/postgresql.ps1
+++ b/coin/provisioning/common/windows/postgresql.ps1
@@ -40,7 +40,7 @@ $version = "9.1.9-1"
$packagex64 = "C:\Windows\temp\postgresql-$version-windows-x64-binaries.zip"
$packagex86 = "C:\Windows\temp\postgresql-$version-windows-binaries.zip"
-if( (is64bitWinHost) -eq 1 ) {
+if (Is64BitWinHost) {
# Install x64 bit versions
$architecture = "x64"
$installFolder = "C:\Utils\postgresql\pgsql"
@@ -48,18 +48,17 @@ if( (is64bitWinHost) -eq 1 ) {
$internalUrl = "\\ci-files01-hki.intra.qt.io\provisioning\windows\postgresql-$version-windows-x64-binaries.zip"
$sha1 = "4da0453cdfda335e064d4437cf5bb9d356054cfd"
- echo "Fetching from URL ..."
+ Write-Host "Fetching from URL ..."
Download $externalUrl $internalUrl $packagex64
Verify-Checksum $packagex64 $sha1
- echo "Installing $packagex64 ..."
+ Write-Host "Installing $packagex64 ..."
Extract-Dev-Folders-From-Zip $packagex64 "pgsql" $installFolder
- echo "Remove downloaded $packagex64 ..."
- Remove-Item $packagex64
+ Write-Host "Remove downloaded $packagex64 ..."
+ Remove-Item -Path $packagex64
- echo "Set $architecture environment variables ..."
- [Environment]::SetEnvironmentVariable("POSTGRESQL_INCLUDE_x64", "$installFolder\include", "Machine")
- [Environment]::SetEnvironmentVariable("POSTGRESQL_LIB_x64", "$installFolder\lib", "Machine")
+ Set-EnvironmentVariable "POSTGRESQL_INCLUDE_x64" "$installFolder\include"
+ Set-EnvironmentVariable "POSTGRESQL_LIB_x64" "$installFolder\lib"
}
# Install x86 bit version
@@ -67,26 +66,24 @@ $architecture = "x86"
$externalUrl = "http://get.enterprisedb.com/postgresql/postgresql-$version-windows-binaries.zip"
$internalUrl = "\\ci-files01-hki.intra.qt.io\provisioning\windows\postgresql-$version-windows-binaries.zip"
$sha1 = "eb4f01845e1592800edbb74f60944b6c0aca51a9"
-if( (is64bitWinHost) -eq 1 ) {
+if (Is64BitWinHost) {
$installFolder = "C:\Utils\postgresql$architecture\pgsql"
-}
-else {
+} else {
$installFolder = "C:\Utils\postgresql\pgsql"
}
-echo "Fetching from URL..."
+Write-Host "Fetching from URL..."
Download $externalUrl $internalUrl $packagex86
Verify-Checksum $packagex86 $sha1
-echo "Installing $packagex86 ..."
+Write-Host "Installing $packagex86 ..."
Extract-Dev-Folders-From-Zip $packagex86 "pgsql" $installFolder
-echo "Remove downloaded $packagex86 ..."
-Remove-Item $packagex86
+Write-Host "Remove downloaded $packagex86 ..."
+Remove-Item -Path $packagex86
-echo "Set $architecture environment variables ..."
-[Environment]::SetEnvironmentVariable("POSTGRESQL_INCLUDE_x86", "$installFolder\include", "Machine")
-[Environment]::SetEnvironmentVariable("POSTGRESQL_LIB_x86", "$installFolder\lib", "Machine")
+Set-EnvironmentVariable "POSTGRESQL_INCLUDE_x86" "$installFolder\include"
+Set-EnvironmentVariable "POSTGRESQL_LIB_x86" "$installFolder\lib"
# Store version information to ~/versions.txt, which is used to print version information to provision log.
-echo "PostgreSQL = $version" >> ~/versions.txt
+Write-Output "PostgreSQL = $version" >> ~/versions.txt