Skip to content

Debug-Runspace Example 1 Fails when using SSHTransport to both Windows and Linux SSH targets #13260

@JustinGrote

Description

@JustinGrote

@PaulHigin

Steps to reproduce

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/debug-runspace?view=powershell-7#example-1--debug-a-remote-runspace

Enter-PSSession -Hostname "tinycloud.us.to"
[tinycloud.us.to]: PS /home/jgrote> Enter-PSHostProcess -Id 1152

Expected behavior

Enter the secondary process

Actual behavior

Type           : System.Management.Automation.CmdletInvocationException
ErrorRecord    :
    Exception             :
        Type        : System.Management.Automation.PSNotSupportedException
        ErrorRecord :
            Exception             :
                Type    : System.Management.Automation.ParentContainsErrorRecordException
                Message : Specified method is not supported.
                HResult : -2146233087
            CategoryInfo          : NotImplemented: (:) [], ParentContainsErrorRecordException
            FullyQualifiedErrorId : NotSupported
        TargetSite  :
            Name          : PushRunspace
            DeclaringType : System.Management.Automation.Remoting.ServerDriverRemoteHost,
System.Management.Automation, Version=7.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
            MemberType    : Method
            Module        : System.Management.Automation.dll
        StackTrace  :
   at System.Management.Automation.Remoting.ServerDriverRemoteHost.PushRunspace(Runspace runspace)
   at System.Management.Automation.Remoting.ServerRemoteHost.PushRunspace(Runspace runspace)
   at System.Management.Automation.Internal.Host.InternalHost.PushRunspace(Runspace runspace)
   at Microsoft.PowerShell.Commands.EnterPSHostProcessCommand.EndProcessing()
        Message     : Specified method is not supported.
        Source      : System.Management.Automation
        HResult     : -2146233067
    TargetObject          : Microsoft.PowerShell.Commands.EnterPSHostProcessCommand
    CategoryInfo          : InvalidOperation: (Microsoft.PowerShel…SHostProcessCommand:EnterPSHostProcessCommand)
[Enter-PSHostProcess], PSNotSupportedException
    FullyQualifiedErrorId :
EnterPSHostProcessCannotPushRunspace,Microsoft.PowerShell.Commands.EnterPSHostProcessCommand
    InvocationInfo        :
        MyCommand       : Enter-PSHostProcess
        HistoryId       : 1
        InvocationName  : enter-pshostprocess
        CommandOrigin   : Internal
    PipelineIterationInfo :





TargetSite     :
    Name          : Throw
    DeclaringType : System.Runtime.ExceptionServices.ExceptionDispatchInfo
    MemberType    : Method
    Module        : System.Private.CoreLib.dll
StackTrace     :
   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)
   at System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper()
   at System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc()
Message        : Specified method is not supported.
InnerException :
    Type        : System.Management.Automation.PSNotSupportedException
    ErrorRecord :
        Exception             :
            Type    : System.Management.Automation.ParentContainsErrorRecordException
            Message : Specified method is not supported.
            HResult : -2146233087
        CategoryInfo          : NotImplemented: (:) [], ParentContainsErrorRecordException
        FullyQualifiedErrorId : NotSupported
    TargetSite  :
        Name          : PushRunspace
        DeclaringType : System.Management.Automation.Remoting.ServerDriverRemoteHost, System.Management.Automation,
Version=7.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
        MemberType    : Method
        Module        : System.Management.Automation.dll
    StackTrace  :
   at System.Management.Automation.Remoting.ServerDriverRemoteHost.PushRunspace(Runspace runspace)
   at System.Management.Automation.Remoting.ServerRemoteHost.PushRunspace(Runspace runspace)
   at System.Management.Automation.Internal.Host.InternalHost.PushRunspace(Runspace runspace)
   at Microsoft.PowerShell.Commands.EnterPSHostProcessCommand.EndProcessing()
    Message     : Specified method is not supported.
    Source      : System.Management.Automation
    HResult     : -2146233067
Source         : System.Private.CoreLib
HResult        : -2146233087

Environment data

Name                           Value
----                           -----
PSVersion                      7.0.3
PSEdition                      Core
GitCommitId                    7.0.3
OS                             Linux 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Notes

Works fine with WSMan on windows, but same host using SSH transport throws same error

Also, it appears that the runspace is closed prior to the pushrunspace, maybe getting prematurely closed?

[tinycloud.us.to]: PS /home/jgrote> get-runspace

 Id Name            ComputerName    Type          State         Availability
 -- ----            ------------    ----          -----         ------------
  1 RemoteHost      localhost       Local         Opened        Busy
  2 PSAttachRunspa… localhost       Remote        Closed        None
  3 PSAttachRunspa… localhost       Remote        Closed        None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-AnsweredThe question is answered.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions