Steps to reproduce
$rs = [runspacefactory]::CreateRunspace()
$rs.Open()
$Host.PushRunspace($rs)
Expected behavior
Either throw a NotSupportedException that states only remote runspaces are supported, or (preferably) enter the local runspace successfully.
Actual behavior
> $rs = [runspacefactory]::CreateRunspace()
> $rs.Open()
> $Host.PushRunspace($rs)
Exception calling "PushRunspace" with "1" argument(s): "Object reference not set to an instance of an object."
At line:1 char:1
+ $Host.PushRunspace($rs)
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : NullReferenceException
> $Error[0].Exception.InnerException | Format-List * -Force
Message : Object reference not set to an instance of an object.
Data : {}
InnerException :
TargetSite : Void PushRunspace(System.Management.Automation.Runspaces.Runspace)
StackTrace : at Microsoft.PowerShell.ConsoleHost.PushRunspace(Runspace newRunspace)
at CallSite.Target(Closure , CallSite , Object , Object )
HelpLink :
Source : Microsoft.PowerShell.ConsoleHost
HResult : -2147467261
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 6.0.0-rc.2
PSEdition Core
GitCommitId v6.0.0-rc.2
OS Microsoft Windows 10.0.15063
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Steps to reproduce
Expected behavior
Either throw a
NotSupportedExceptionthat states only remote runspaces are supported, or (preferably) enter the local runspace successfully.Actual behavior
Environment data