You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PowerShell Core Enter-PSSession not exiting gracefully in Windows when connected to Linux. #4686
I'm happy to say that I love connectivity in both directions 'Linux-to-Windows' and Windows-to-Linux' using OpenSSH-Win64. Now, in beta-6, I notice when exiting from Linux using Enter-PSSession in Windows, it doesn't exit gracefully. Meaning, that when typing 'Exit', its giving an error when it shouldn't.
Steps to reproduce
In Windows -> connect to Linux:
PS> Enter-PSSession -hostname orion -username maxt
:
[orion]: PS /home/maxt> exit
(gives error message and then disconnect)
Enter-PSSession-hostname orion -username maxt
Expected behavior
Typing 'exit' should terminate session without any errors
Actual behavior
Error message when exiting session.
PowerShell v6.0.0-beta.6
Copyright (C) Microsoft Corporation. All rights reserved.
WARNING: Appended Windows PowerShell PSModulePath
Loading personal and system profiles took 2520ms.
PS C:\Program Files\PowerShell\6.0.0-beta.6> enter-pssession -HostName orion -UserName maxt
maxt@orion's password:
[orion]: PS /home/maxt> exit
A task was canceled.
The SSH client session has ended with error message: A task was canceled.
+ CategoryInfo : ResourceUnavailable: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : System.Management.Automation.Remoting.PSRemotingDataStructureException
PS C:\Program Files\PowerShell\6.0.0-beta.6>
Environment data
Windows 10 Insider Build 16257
Ubuntu 16.04.3 LTS
openssh 0.0.19.0
PS C:\Program Files\PowerShell\6.0.0-beta.6>$PSVersionTable
Name Value
---------
PSVersion 6.0.0-beta
PSEdition Core
GitCommitId v6.0.0-beta.6
OS Microsoft Windows 10.0.16275
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Maximo Trinidad (@MaximoTrinidad)
Thanks for reporting this. This is a regression I introduced with #4475. The CloseAsync() method should not prematurely clean up connection state unless a connection was never established, and this is causing the exception to be thrown. I have a fix for it and I'll create a PR soon.
Activity
iSazonov commentedon Aug 28, 2017
/cc Paul Higinbotham (@PaulHigin) Could you please look the Issue - it seems we should catch the exception.
PaulHigin commentedon Aug 28, 2017
Maximo Trinidad (@MaximoTrinidad)
Thanks for reporting this. This is a regression I introduced with #4475. The CloseAsync() method should not prematurely clean up connection state unless a connection was never established, and this is causing the exception to be thrown. I have a fix for it and I'll create a PR soon.
iSazonov commentedon Sep 12, 2017
Paul Higinbotham (@PaulHigin) Can we close the Issue?
PaulHigin commentedon Sep 12, 2017
Yes, the fix has been merged. Thanks.