forked from PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRemotingCmdlets.Tests.ps1
More file actions
19 lines (16 loc) · 1020 Bytes
/
Copy pathRemotingCmdlets.Tests.ps1
File metadata and controls
19 lines (16 loc) · 1020 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
Describe "SSH Remoting Cmdlet Tests" -Tags "Feature" {
It "Enter-PSSession HostName parameter set should throw error for invalid key path" {
{ Enter-PSSession -HostName localhost -UserName User -KeyFilePath NoKeyFile } |
Should -Throw -ErrorId "PathNotFound,Microsoft.PowerShell.Commands.EnterPSSessionCommand"
}
It "New-PSSession HostName parameter set should throw error for invalid key path" {
{ New-PSSession -HostName localhost -UserName User -KeyFilePath NoKeyFile } |
Should -Throw -ErrorId "PathNotFound,Microsoft.PowerShell.Commands.NewPSSessionCommand"
}
It "Invoke-Command HostName parameter set should throw error for invalid key path" {
{ Invoke-Command -HostName localhost -UserName User -KeyFilePath NoKeyFile -ScriptBlock {1} } |
Should -Throw -ErrorId "PathNotFound,Microsoft.PowerShell.Commands.InvokeCommandCommand"
}
}