Fix SSH remoting test to work on all platforms (#11500)

This commit is contained in:
Paul Higinbotham
2020-01-07 14:01:06 -08:00
committed by Aditya Patwardhan
parent b3bd2d4de6
commit f22bad1d58
@@ -55,6 +55,18 @@ Describe "SSHConnection parameter hashtable type conversions" -Tags 'Feature', '
It "<testName>" -TestCases $TestCasesSSHConnection {
param($scriptBlock)
{ & $scriptBlock } | Should -Throw -ErrorId '2100,PSSessionOpenFailed'
$err = $null
try
{
& $scriptBlock
}
catch
{
$err = $_
}
# The exact returned error id string varies depending on platform,
# but will always contain 'PSSessionOpenFailed'.
$err.FullyQualifiedErrorId | Should -Match 'PSSessionOpenFailed'
}
}