Tips and tricks: PowerShell ISE 3.0

I haven’t written anything for a while and much has happened in the world of PowerShell since my previous post.
To sum it up: Windows 8 and Server 2012 have been released and with them – PowerShell 3.0.

What’s new in PowerShell 3.0?
Lots. And then some.
I’m not going to go through all the new stuff now, but here is a good summary: http://technet.microsoft.com/en-us/library/hh857339.aspx

I am instead going to post a few tricks you can do with the new edition of the PowerShell Integrated Scripting Environment (ISE).

1. Edit tab titles

I often work with multiple tabs in the ISE and when all new tabs automatically get named “PowerShell” followed by a number, it doesn’t take many tabs before losing control of which tabs are which.

What surprises me is that there is no way to right-click the tab and select Rename. I can’t help but think that would be a trivial thing to add.

This is how to rename the titles of your tabs:

$psISE.CurrentPowerShellTab.DisplayName = "Custom name"

2. Insert Snippets

While perhaps mostly a beginners function, the 3.0 version of the ISE allows insertion of some template “snippets”.

These are syntactically correct code blocks with templates for if statements, while loops, for loops and so on.

My personal favorite is the Cmdlet (advanced function). I always disliked writing the documentation part at the beginning of my Cmdlets and this one does some of it for me.

Snippets can be found on the edit menu or by using the Ctrl+J shortcut.

3. ISE Add-ons

The ISE has built-in support for add-ons. You can find add-ons by going to the Add-ons menu in ISE (Add-ons -> Open Add-on Tools Website)

The website has add-ons ready for download. It also provides some guides for those wanting to write their own ISE add-ons.