@@ -29,13 +29,11 @@ Register-PSFConfigValidation -Name "transaction" -ScriptBlock {
29
29
try {
30
30
if (([string ]$Value ) -in @ (' SingleTransaction' , ' TransactionPerScript' , ' NoTransaction' )) {
31
31
$Result.Value = [string ]$Value
32
- }
33
- else {
32
+ } else {
34
33
$Result.Message = " Allowed values: SingleTransaction, TransactionPerScript, NoTransaction"
35
34
$Result.Success = $False
36
35
}
37
- }
38
- catch {
36
+ } catch {
39
37
$Result.Message = " Failed to convert value to string"
40
38
$Result.Success = $False
41
39
}
@@ -55,8 +53,7 @@ Register-PSFConfigValidation -Name "securestring" -ScriptBlock {
55
53
}
56
54
if ($Value -is [securestring ]) {
57
55
$Result.Value = $Value
58
- }
59
- else {
56
+ } else {
60
57
$Result.Message = ' Only [securestring] is accepted'
61
58
$Result.Success = $False
62
59
}
@@ -76,13 +73,11 @@ Register-PSFConfigValidation -Name "hashtable" -ScriptBlock {
76
73
try {
77
74
if (([hashtable ]$Value ) -is [hashtable ]) {
78
75
$Result.Value = [hashtable ]$Value
79
- }
80
- else {
76
+ } else {
81
77
$Result.Message = " Only hashtables are allowed"
82
78
$Result.Success = $False
83
79
}
84
- }
85
- catch {
80
+ } catch {
86
81
$Result.Message = " Failed to convert value to hashtable. Only hashtables are allowed."
87
82
$Result.Success = $False
88
83
}
@@ -103,13 +98,11 @@ Register-PSFConfigValidation -Name "connectionType" -ScriptBlock {
103
98
try {
104
99
if (([string ]$Value ) -is [string ] -and [string ]$Value -in $allowedTypes ) {
105
100
$Result.Value = [string ]$Value
106
- }
107
- else {
101
+ } else {
108
102
$Result.Message = $failMessage
109
103
$Result.Success = $False
110
104
}
111
- }
112
- catch {
105
+ } catch {
113
106
$Result.Message = " Failed to convert value to string. $failMessage "
114
107
$Result.Success = $False
115
108
}
@@ -157,7 +150,7 @@ if ($typeData) {
157
150
$cS = $this.ExecutionManager.ConnectionContext.ConnectionString.Split (' ;' ) | Where-Object { $_.Split (' =' )[0 ] -ne ' Database' }
158
151
$cS += " Database=$ ( $this.Name ) "
159
152
$connectionString = $cS -join ' ;'
160
- Invoke-DBODeployment - InputObject $Package - ConnectionString $connectionString
153
+ Install-DBOPackage - InputObject $Package - ConnectionString $connectionString
161
154
} - ErrorAction Ignore
162
155
}
163
156
if (! $typeData.Members.ContainsKey (' DeployScript' )) {
@@ -168,7 +161,7 @@ if ($typeData) {
168
161
$cS = $this.ExecutionManager.ConnectionContext.ConnectionString.Split (' ;' ) | Where-Object { $_.Split (' =' )[0 ] -ne ' Database' }
169
162
$cS += " Database=$ ( $this.Name ) "
170
163
$connectionString = $cS -join ' ;'
171
- Invoke-DBODeployment - ScriptPath $Path - ConnectionString $connectionString
164
+ Install-DBOSqlScript - ScriptPath $Path - ConnectionString $connectionString
172
165
} - ErrorAction Ignore
173
166
}
174
167
}
0 commit comments