PowerShell Command Add-On

Many of us use PowerCLI, which relies on PowerShell. The default PowerCLI environment is pretty plain, but you can also use the PowerShell ISE  and load the PowerCLI snap-ins in your profile. The ISE, or Integrated Scripting Environment, offers a lot of advantages to the regular PowerCLI or PowerShell interfaces: Intellitype, lots of keyboard shorts, and something called the Command Add-On.

First, let’s look at how to turn it on. Fire up the ISE. If you have Powershell pinned on your taskbar, you can right click and choose the ISE, or just hit the windows key and type ‘ISE’. You want the regular version of PowerShell ISE, not the “(x86)” version. Now that it’s open, go to View -> Show Command Add-On and select it:

fig 1

On the right hand side, you’ll now see the Command Add-On:

fig 2

What can you do with this pane? Lots. For one, you can search for cmdlets by typing in the “Name:” field and you can restrict the search by selecting the Module. When you select a cmdlet, you’ll see this:

fig 3

There’s some REALLY awesome things here. First, the blue icon with a question mark will open the help page for the cmdlet. Next, you have one tab for each cmdlet “signature”. Each signature is a set of arguments that the cmdlet can accept. If you hold your mouse over any field name, like “Datastore:”, you’ll see a tooltip that shows you the expected type, whether the argument is optional, and if it can be accepted on the pipeline. Go ahead and put some information in the fields, it really doesn’t matter what. Look at the bottom of the pane:

fig 4

These buttons take the information you filled in and either run the command, insert it in the Console pane, or copies it to the copy and paste buffer. You don’t have to worry about getting formatting correct, it does it for you. If you’re writing a script, it can be easier to fill in some information here, hit copy, and then paste in the Script pane. You can also run a cmdlet, change the arguments slightly, and hit run again. Whatever you need to do.

Please, learn to use the Command Add-On. It’s a very powerful part of the ISE and it will help you with rapid application development and learning. Enjoy!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s