-
Notifications
You must be signed in to change notification settings - Fork 3
/
config_template.ps1
70 lines (57 loc) · 2.42 KB
/
config_template.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
param(
[switch]$Install
)
# Pull global variables from Windows Registry.
$RegistryPath = "HKCU:\Software\HexisData\hqTestLite"
Get-Item -Path $RegistryPath | Select-Object -ExpandProperty Property | ForEach-Object {
$PropertyName = $_
switch -Wildcard ($(Get-ItemPropertyValue -Path $RegistryPath -Name $PropertyName).GetType()) {
"byte*" {
$PropertyValue = [bool](Get-ItemPropertyValue -Path $RegistryPath -Name $PropertyName)
}
default {
$PropertyValue = Get-ItemPropertyValue -Path $RegistryPath -Name $PropertyName
}
}
Set-Variable -Name $PropertyName -Value $PropertyValue -Scope Global
}
# Set global variables not populated in Windows Registry.
# MEDM installation path.
If (!$MedmProcessAgentPath) { $Global:MedmProcessAgentPath = "C:\Program Files\Markit Group\Markit EDM_17_1_132_0\CadisProcessAgent.exe" }
# WinMerge command line config.
If (!$TextDiffExe) { $Global:TextDiffExe = "C:\Program Files (x86)\WinMerge\WinMergeU.exe" }
If (!$TextDiffParams) { $Global:TextDiffParams = @("/e", "/s", "/u", "/wl", "/wr", "/dl", "Current Result", "/dr", "Certified Result", "{{CurrentResult}}", "{{CertifiedResult}}") }
# Default script type for results reporting.
If (!$SqlScriptType) { $Global:SqlScriptType = "Sql Script" }
# Default directory for report files..
If (!$ReportFolder) { $Global:ReportFolder = "C:\hqTestLite\Results" }
# Execute tests with user input by default.
If (!$NoInput) { $Global:NoInput = $false }
# Active Environment.
If (!$ActiveEnvironment) { $Global:ActiveEnvironment = "DEV" }
# Specify per-environment settings here.
switch ($ActiveEnvironment) {
"DEV" {
$Global:EnvMedmDbServer = "DevServerName"
$Global:EnvMedmDbName = "DevDbName"
$Global:EnvBbgPxFileInDir = "\\netshare\DEV\bbg\price\IN"
$Global:EnvBbgSecFileInDir = "\\netshare\DEV\bbg\security\IN"
break
}
"TEST" {
$Global:EnvMedmDbServer = "TestServerName"
$Global:EnvMedmDbName = "TestDbName"
$Global:EnvBbgPxFileInDir = "\\netshare\TEST\bbg\price\IN"
$Global:EnvBbgSecFileInDir = "\\netshare\TEST\bbg\security\IN"
break
}
default {
Write-Host "Unknown environment!"
If (!$Install) {
[void](Read-Host "Press Enter to exit")
[Environment]::Exit(1)
}
}
}
# Import hqTestLite module.
Import-Module "$ModuleDir\hqTestLite.psm1" -NoClobber