Windows PowerShell ISE (Integrated Scripting Environment) is a bundled script editor for PowerShell. Here is why you should use it.
Beyond the PowerShell Prompt
PowerShell is a command line tool at its core. It can be used to its fullest extent from an interactive shell prompt. But beyond ad-hoc work, cmdlet exploration and command one-liners, you should be using a script editor for building more complex PowerShell scripts. Luckily, beginning with PowerShell v2 the Windows PowerShell ISE has been included as a companion PowerShell script development environment. The rest of this post is specifically referencing Windows PowerShell ISE v5 (Windows 10), but a lot of these features are included in earlier versions too.
Advantages of Windows PowerShell ISE
Windows PowerShell ISE is more than just a graphical editor for writing and running scripts (though that is an advantage itself!). Here are some of the ISE features that will make your PowerShell work much more pleasant:
- Syntax highlighting. Makes code MUCH more readable!
- Intellisense (Auto-completion). Provides suggestions to complete cmdlet names, assist with available parameter options for a cmdlet, or show available variables or object properties. This works in both the editor pane as well as the console pane.
- Tabbed interface. Have multiple script files open at one time within the same window. I usually have one tab containing my master script, another tab for writing and testing a particular section of the script, and potentially another scratch tab for just trying stuff out.
- Selective execution. Taking a page from SQL Management Studio, you can highlight a selection of continuous lines and execute them independently from the rest of the script. This is useful if you just want to test one line of code, or re-load a variable with a different value.
- Debugging. Coupled with the cmdlet Set-PSBreakpoint, walk through your script for in-depth troubleshooting and analysis.
- Code folding. Collapse functions, comment sections, and regions to make a script easier to read.
Extend Functionality with Add-Ons
In addition to a great set of core features, Windows PowerShell ISE is extendable via Add-Ons. An Add-On can be created with Visual Studio, and there is a growing ecosystem of community created Add-Ons. A good place to start is with three Microsoft authored Add-Ons that are easily findable in the ISE under the menu item Add-Ons:
- Script Browser – search for over 9000 script samples in the TechNet Script Center.
- Script Analyzer – checks the quality of Windows PowerShell code by running a set of rules based on PowerShell best practices identified by PowerShell Team and the community.
- Module Browser -find, install, and publish modules through the PowerShell Gallery. Built on top of PowerShellGet.
What’s Next for Windows PowerShell ISE
The ISE has always received an update in tandem with a new version of PowerShell and Windows Management Framework, but that may be changing. A recent announcement of a Windows PowerShell ISE preview edition promising to add features and functionality at a faster pace may change how ISE is delivered.
- Find Windows PowerShell ISE in your start menu and pin it to Start, pin it to your taskbar, put a shortcut on your desktop, whatever works for you.
- Get coding!
Leave a Reply