File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,12 @@ try {
135
135
$outputCollection = $ps.EndInvoke ($asyncResult )
136
136
write-traces
137
137
138
+ if ($ps.HadErrors ) {
139
+ # If there are any errors, we will exit with an error code
140
+ Write-DscTrace - Now - Level Error - Message ' Errors occurred during script execution.'
141
+ exit 1
142
+ }
143
+
138
144
foreach ($output in $outputCollection ) {
139
145
$outputObjects.Add ($output )
140
146
}
@@ -147,12 +153,6 @@ finally {
147
153
$ps.Dispose ()
148
154
}
149
155
150
- if ($ps.HadErrors ) {
151
- # If there are any errors, we will exit with an error code
152
- Write-DscTrace - Now - Level Error - Message ' Errors occurred during script execution.'
153
- exit 1
154
- }
155
-
156
156
# Test should return a single boolean value indicating if in the desired state
157
157
if ($Operation -eq ' Test' ) {
158
158
if ($outputObjects.Count -eq 1 -and $outputObjects [0 ] -is [bool ]) {
You can’t perform that action at this time.
0 commit comments