What makes a good PowerShell editor?

Windows PowerShell v2 ships with an "Integrated Scripting Environment," or ISE. It's actually intended to be a "graphical shell" (and was originally called that), and one of its driving features is support for double-byte character sets. That's right, the original text-based console can't handle double-byte character sets, which means a lot of people couldn't use the shell because it couldn't display their language.

Anyway, in addition to that better character support, the ISE also adds a few Visual Studio-esque features designed to make PowerShell a bit easier to work with. So let's consider some of the major features that go into a better editing experience. 

First, we have to draw a distinction between an interactive shell and a script editor. A shell is designed to let you type a command, hit enter, and see the results; an editor is designed to let you type a bunch of commands and then run them all as a batch. Some editors blur the line: The ISE, for example, includes an interactive pane as well as a script pane, and you can hide the script pane if you just want to use the interactive mode. Ideally, most of the features I'll be describing should work in both interactive and scripting mode - but that isn't always the case in the ISE, and it also isn't the case with other editors you might find.

One of the core features any good editor should include is support for better formatting. I like to see color-coding of commands and parameters, automatic indenting for scripting constructs, and at least basic undo/redo support. Ideally, I like editors that persist undo information someplace (often in an alternate stream of the file) so that I can access undo steps even after closing the file and reopening it months later.

Another core feature is code hinting and completion, what Microsoft calls "IntelliSense." This usually manifests in two ways: Little pop-up menus that appear when you start typing a command, and help you complete the command more quickly, and little tool tips that remind you of command syntax. Ideally, command completion will also work for things like parameters, WMI classes (although that's technically complicated to implement), and other things. The idea is to help you type quicker and more accurately, and reduce the need to turn to the help files.

Snippets of some kind are another good feature to have: Once you've mastered a complicated command or a hunk of script, snippets offer a way to save that and re-use it easily in the future. Think of them as a kind of permanent clipboard; I like snippet features that are keyboard-accessible, perhaps using a command completion-like pop-up menu.

Access to debugging features is also key. I want to be able to click somewhere to set breakpoints, and when a script is in "break" mode I want to hover over variables and, ideally, object properties to see what values are contained within them. PowerShell supports a variety of breakpoints, and an editor should provide support for all of them (even if it does so by using its own debugging mechanism rather than the shell's). 

Quick access to help is a must-have. I don't want to view the help inline; I want it in a different pane, so I can float it to the side and access it while I'm typing a command. It should be context-sensitive, so that I can move my cursor over a command, hit a function key, and have the help for that command pop right up. An especially smart help window would realize when I'm over a WMI class and perhaps pull up online documentation for that class. 

Finally, I want an editor to make it easy to utilize PowerShell extensions - snap-ins and modules. An editor should be willing to run my profile script, so that whatever custom stuff I have in there also takes place in the editor. 
Many commercial editors pack in these features and many more; the PowerShell ISE included with PowerShell v2 doesn't provide all of them (and I don't think it should - Microsoft shouldn't be trying to replicate Visual Studio for PowerShell, and they shouldn't be giving the competitive PowerShell editor market a reason to stop selling their products). 

Why am I so concerned about what makes for a good editor? Beginning in June 2010, I'm going to start reviewing some of the major editors that are on the market, and what's in this article will form my evaluation criteria. I'll explore a new editor product every other week or so, and conclude with a roundup. This is a good time for you to share your must-have features, as well - leave a comment and let me know what you care about in a PowerShell editor.

Discuss this Blog Entry 10

Fargo4 (not verified)
on Oct 5, 2010
Idera's PowerShell Plus features a powerful interactive console, an advanced script editor and debugger and a comprehensive interactive learning center all integrated into a single product. You can download a free 30-trial at www.idera.com/powershellplus
Trevor Sullivan (not verified)
on May 4, 2010
You already hit on it, but I think making it easy to use snap-ins and modules is very much a key feature of a good PowerShell ISE. Also, the debugger is another key component, and having features such as a variable browser are priceless.

One thing you should keep in mind while reviewing these products, are how well their debuggers perform when working anything besides the common cmdlets. For example, I ran into serious issues (application crashes) when debugging a WinForms PowerShell script using Quest PowerGUI. My script should not be able to crash the debugger.

xcud (not verified)
on May 3, 2010
Please include tools adjacent to the editors like the visualization apps; i.e. PowerWF, PrimalForms, PowerGUI, etc in your reviews.
jkavanagh58 (not verified)
on May 9, 2010
IntelliSense without being imposing and the console interaction. Coming from vbscript I loved PrimalScript but with Powershell I have moved to PowershellPlus. The main reason is the implementation of their enhanced console and the abiility to interact with the code editor as well.
Bartek B (not verified)
on May 4, 2010
Besides things you've mentioned: what I also like about ISE is possibility to launch part of the code and see the results. It helps a lot when you try to write complex expression and want to make sure that outcome is what you would expect it to be.
Another thing: $profile, to have some things already "there", but not necessarily same as in powershell.exe.
And last but not least: regular expressions in find & replace functions. I love notepad2 for that feature and I use it a lot (also when I have to write some .cmd and .vbs code), I'm not sure if other tools also have it (I know PrimalPad did not, and that was main reason why I decided to use notepad2 as stand-alone editor).

on May 14, 2010
For new powershell users context sensitive help is very important, perhaps being able to look back on the line from the cursor and find the last cmdlet or key word and if nothing else invoke the -online feature to go to thier help and if that wasn't available to go to the microsoft source, assuming internet connectivity is available. Try this open a script in ISE, PowerGUI, PowerShellPlus and PrimalScript. Type in the work strict and hit F1. Why doesn't StrictMode come up in a context sensitive help search on any of them.

Not easy to implement but the one that gets it right wins.

hjmiii (not verified)
on May 4, 2010
You hit on IntelliSense, but I find many implementations of code hinting and completion lacking. If I'm writing a script that adds a module or snapin or loads a .NET assembly, then from any point in the script after that line I should have access to the code hints for it. PowerGui for example only loads hints if you highlight the line and execute it to load that library into memory. Primalscript and ISE force you to think ahead and add things to your profile to access the hints. The same goes for variables. If I define a type for a variable, then I expect the members of that type to be available in code hints.
jbrinkman (not verified)
on May 4, 2010
A key feature for me is for my editor to work hand in hand with my console. I want to be able to use my standard console, and when necessary open a script in the editor, make some changes and re-execute the script to update some function that I am using. Often my scripts start out small, and over time, as I use them more and more, I make adjustments to them. The more seamless that task is, the more likely it is that I will actually implement my changes when I am thinking about them.
AlexRiedel (not verified)
on Jun 3, 2010
jadelise, PrimalScript 2009 shows the help for Set-StrictMode if you hit F1 on the word "strict".

"I own Primalscript and the only issue I have with it are lack of PS profile support in the debugger"

PrimalScript 2009's debugger uses it's own profile, since it is a different host from PowerShell.exe. Please contact us if you need help finiding the PrimalScript profile.

Anonymous (not verified)
on May 19, 2010

I own Primalscript and the only issue I have with it are lack of PS profile support in the debugger. Otherwise great product that my single license allows me to install on my workstation at work and my laptop for when I am on the road.

I have tested (trial) Powershell Plus and I agree the cursor jumps a lot but i like it a lot too and probably would switch to it as my preferred editor. However I have been told in chat that if I want would like to install on my workstation and my laptop for when I travel, I have to buy separate license for each although I can't confirm that because Idera doesn't post their EULA and doesn't answer repeated emails requesting to see it. Two licenses is $348 (with the required 20% maintenance) so it is way more costly then competitors.

So, I look forward to your reviews and ask that you comment on each product's EULA in the reviews. Thanks

Please or Register to post comments.

What's PowerShell with a Purpose Blog?

Don Jones demystifies Windows PowerShell.

Blog Archive

Sponsored Introduction Continue on to (or wait seconds) ×