-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefines.ps1
54 lines (46 loc) · 1.45 KB
/
defines.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
add-type -AssemblyName System.Data.OracleClient
#scripts base directory
$dir = "./temp/db";
$global:appSettings = @{}
$configFile = "./ps.config"
if (Test-Path $configFile) {
Try {
$config = [xml](get-content $configFile)
foreach ($addNode in $config.configuration.appsettings.add) {
if ($addNode.Value.Contains(',')) {
$value = $addNode.Value.Split(',')
for ($i = 0; $i -lt $value.length; $i++) {
$value[$i] = $value[$i].Trim()
}
}
else {
$value = $addNode.Value
}
$global:appSettings[$addNode.Key] = $value
}
}
Catch [system.exception] {
}
}
else {
Write-Error -Message "Config dosyası okunamadı." -Category ReadError
}
$username = $global:appSettings["username"]
$password = $global:appSettings["password"]
$data_source = $global:appSettings["data_source"]
$withsqlplus = $global:appSettings["withsqlplus"]
$connection_string = "User Id=$username;Password=$password;Data Source=$data_source"
$outputfolder = $global:appSettings["outputfolder"]
$outputfolder = "$dir/$outputfolder"
$objects = @(
"$dir/SCRIPT/BEFORE_UPDATE"
, "$dir/H4A/VIEW"
, "$dir/H4A/FUNCTION"
, "$dir/H4A/PROCEDURE"
, "$dir/H4A/TYPE_SPEC"
, "$dir/H4A/TYPE_BODY"
, "$dir/H4A/TRIGGER"
, "$dir/H4A/PACKAGE_SPEC"
, "$dir/H4A/PACKAGE_BODY"
, "$dir/SCRIPT/AFTER_UPDATE"
)