I doing some testing creating sessions using New-PSSession with both Windows and Linux. Just discover that I can't use the Disconnect-PSSession cmdlet to terminate my ssh session to my Linux box.
Steps to reproduce
- Create PSSession to Windows and Linux systems:
$linuxSession = New-PSSession -HostName lxsys1 -UserName user1
$windowsSession = New-PSSession -ComputerName winsys2 -Credential user1
Expected behavior
PSSession should have a disconnect state.
Actual behavior
Disconnect error on Linux PSSession.
PS C:\Program Files\PowerShell\6.0.0-beta.9> Disconnect-PSSession -Session $linuxSession
Disconnect-PSSession : Disconnect-PSSession operation failed for runspace Id = 97a7af76-7509-4274-a796-976fb4324d93
for the following reason: The disconnection operation is not supported on the remote computer. To support
disconnecting, the remote computer must be running Windows PowerShell 3.0 or a later version of Windows PowerShell.
At line:1 char:1
+ Disconnect-PSSession -Session $linuxSession
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ([PSSession]SSH3:PSSession) [Disconnect-PSSession], RuntimeException
+ FullyQualifiedErrorId : PSSessionDisconnectFailed,Microsoft.PowerShell.Commands.DisconnectPSSessionCommand
Environment data
Windows 10 Insider Build 17025
PS C:\Program Files\PowerShell\6.0.0-beta.9> $PSVersionTable
Name Value
---- -----
PSVersion 6.0.0-beta.9
PSEdition Core
GitCommitId v6.0.0-beta.9
OS Microsoft Windows 10.0.17025
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
PS C:\Program Files\PowerShell\6.0.0-beta.9>

I doing some testing creating sessions using New-PSSession with both Windows and Linux. Just discover that I can't use the Disconnect-PSSession cmdlet to terminate my ssh session to my Linux box.
Steps to reproduce
Expected behavior
PSSession should have a disconnect state.
Actual behavior
Disconnect error on Linux PSSession.
Environment data
Windows 10 Insider Build 17025