mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Fix SSH remoting test to work on all platforms (#11500)
This commit is contained in:
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'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user