Nestor
Nestor

Reputation: 13990

Powershell console control

Does anybody know of a console control that I can use to host a Powershell console in my WPF app? I have a WPF app that is scriptable with Powershell, and I want to allow the user to open up a PS console to type some commands.

Upvotes: 4

Views: 1339

Answers (2)

Andy Arismendi
Andy Arismendi

Reputation: 52587

Check out this project:

http://poshconsole.codeplex.com/

Its a WPF based console. You can download the source and check it out.

http://poshconsole.codeplex.com/SourceControl/list/changesets

Upvotes: 2

Nick Nieslanik
Nick Nieslanik

Reputation: 4458

If you use the System.Management.Automation.Runspaces Pipeline object to interact with a hosted powershell runspace programmatically, you can bind the input commands and output to any controls of your choosing, such as a TextBox for input and a MultiLine textblock for output or some fancier controls as you like.

Here's a link to the CreatePipeline API doc:

http://msdn.microsoft.com/en-us/library/windows/desktop/system.management.automation.runspaces.runspace.createpipeline(v=vs.85).aspx

Upvotes: 0

Related Questions