Skip to content

Commit ead6e9d

Browse files
committed
Try JobStateInfo
1 parent fab07eb commit ead6e9d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

test/Microsoft.PowerShell.ThreadJob.Tests.ps1

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,6 @@ Describe 'Job2 class API tests' -Tags 'CI' {
440440
It 'Verifies terminating job error' {
441441

442442
$job = Start-ThreadJob -ScriptBlock { throw "My Job Error!" } | Wait-Job
443-
$results = $job | Receive-Job 2>&1
444-
$results | Should -Not -BeNullOrEmpty
445-
$results[0].Exception.Message | Should -Be "My Job Error!"
443+
$job.JobStateInfo.Reason.Message | Should -Be "My Job Error!"
446444
}
447445
}

0 commit comments

Comments
 (0)