views:

74

answers:

3

There are a number of GUI hosts for Powershell (Powershell ISE, PoshConsole, etc) but I'm not aware of any purely console hosts other than powershell.exe. Are there any that offer any advantages over powershell.exe?

I'd like to be able to customise more of the host behaviour - specifically to add and customise key bindings other than TAB, and to customise error reporting. There could well be more...

If there aren't any "extended" versions of powershell.exe that offer this, how difficult would it be to write one? I have the SDK sample code, and it looks fairly accessible, but it's hard to be sure what features powershell.exe provides as opposed to the powershell "engine" (as there's no documentation I've found that focuses specifically on the host capabilities).

A: 

How about Console it can host multiple shells. Might be worth a look.

fenster
Thanks - I already use Console (actually, more often Take Command these days). To some extent, that's why I want a "console subsystem" powershell host like powershell.exe - I can use it with Take Command!
Paul Moore
A: 

If you stick with a "Console" subsystem approach you will be saddled with all the limitations that come along with a Windows console subsystem application. Many complaints about PowerShell.exe limitations are really limitations of this feature of Windows (kbd shortcuts, line editing, etc).

What's wrong with PoshConsole? Even though it allows graphics to be displayed it is still a "console-style" UI on top of the PowerShell engine?

Keith Hill
But keyboard shortcuts and line editing are not limitations of the console subsystem. Certainly, if you just use basic line I/O, you get the limited keyboard handling that the console offers by default, but it's entirely possible to write your own keyboard handling to replace that. As an example, look at JP Software's TCC/LE - a free CMD.EXE replacement with tons of keyboard customisation possibilities.My ideal would be a powershell.exe with such flexibility built in.
Paul Moore
+1  A: 

The best pure-console for PowerShell is obviously PowerShell Plus, which actually uses a fullblown "native" Windows console, but it wraps it up in candy coating and adds tons of IDE-style features. As far as I know this is the only third-party host that's capable of running "graphical" console apps like edit.com

As a sidenote, I'm honestly not sure it's worth the handicap of a true console just to keep compatibility with whatever graphical interactive console applications like Edit.com might still be around. Considering the limitations, and the amount of work that has to be done to pull off something like what PowerShell Plus has... Personally I can't wait for the day when I no longer have to worry about and can move on to console apps that are really MEF-style plugins in a console-style interface like PoshConsole :-)

Jaykul
Thanks. I'll take a look at PowerShell Plus, but to be honest the price is pretty steep given that most of the features it adds (editor, etc), I don't want...
Paul Moore
The key reason I want a console-subsystem app is the ability to use it within Take Command, which I've already paid for, and which does the messy job of wrapping a console in a GUI app. Otherwise, a GUI application like PoshConsole does fine for me (would you accept patches to allow the user to customise key mappings and error reporting, and things like that?)Generally, I use very few console apps that break under a GUI - the most significant is less (a pager more flexible than "more"). Give me a decent pager (and a means of recovering from accidentally starting edit.com) and I'd be happy.
Paul Moore
I absolutely take patches, and would love to take one for key mappings ...
Jaykul
What's wrong with just running PowerShell.exe in Take Command?
Jaykul