Skip to content

Commit 8ae4a70

Browse files
authored
Fix PSVariable object issue for WIndows PowerShell (#25606)
1 parent 7754c7f commit 8ae4a70

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/TestFx/Live/LiveTestUtility.psm1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,11 @@ function Invoke-LiveTestScenario {
302302

303303
do {
304304
try {
305-
$prefs = @([psvariable]::new("ErrorActionPreference", "Stop"))
306305
if ($snrRetryCount -eq $script:ScenarioMaxRetryCount) {
307-
$prefs += [psvariable]::new("DebugPreference", "Continue")
306+
$prefs = @([psvariable]::new("ErrorActionPreference", "Stop"), [psvariable]::new("DebugPreference", "Continue"))
307+
}
308+
else {
309+
$prefs = [psvariable]::new("ErrorActionPreference", "Stop")
308310
}
309311

310312
$ScenarioScript.InvokeWithContext($null, $prefs, $snrResourceGroup)

0 commit comments

Comments
 (0)