Skip to content
Discussion options

You must be logged in to vote

Hi! From what you describe, the main limitation seems to be the distinction between attaching to an existing PowerShell host process and creating a new runspace with a custom InitialSessionState.

Enter-PSHostProcess primarily provides process attachment and runspace debugging capabilities. Although it supports connecting through a named pipe, it does not expose an option to supply a custom InitialSessionState for the runspace created for that connection.

There is a public SDK type worth looking into:

System.Management.Automation.Remoting.RemoteSessionNamedPipeServer

It exposes CreateCustomNamedPipeServer(string). However, the documented API does not appear to provide a way to inject a cus…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Herrmel
Comment options

Answer selected by Herrmel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants