Skip to content

PowerShell Core Enter-PSSession not exiting gracefully in Windows when connected to Linux. #4686

@MaximoTrinidad

Description

@MaximoTrinidad

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

psession_exit_error

Metadata

Metadata

Assignees

Labels

Resolution-FixedThe issue is fixed.WG-RemotingPSRP issues with any transport layer

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions