1

I'm trying to embed PS in my .NET app to make part of object model easily discoverable and have the ability to navigate it. It is easy to create runspace, prompt user for some script as plain string, run the script in the runspace and output something to the user. But in that way it lacks interactivity - user doesn't get auto-completion, IntelliSense, tooltips etc, thus he is required to issue Get-Members constantly just to know what he can do with given objects.

As I understand interactivity is provided by PSHost thing. Is it possible to go without implementing it manually in the application, but rather expose embedded runspace somehow, so I can connect to it with PowerGUI for example? Enter-PSSession or something alike.

1

1 Answer 1

1

I am pretty sure you will have to implement your own tab completion as that's done by the PowerShell Host.

Sign up to request clarification or add additional context in comments.

1 Comment

Sort of. The bulk of the business logic is in TabExpanion() [or TabExpansion2() in v3]. You just need to provide the passing of user input and display of output to the user in your host.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.