Monday, August 12, 2013

My best new features in Powershell v3 and v4

Powershell is getting more and more used. My love for this commandline and scripting environment goes back to 2007 when Exchange Server 2007 was released. I was always a pro automation guy. IMO you can't be a good professional if you don't know how to script.

Now with the new version 3 of Powershell, the Microsoft Team introduced lot of new features. Here is a list of some of my quick favorites.

Show-Command


Do you ever get lost in all available cmdlets? Well I do. In Powershell v3 a new cmdlet is introduced called "Show-Command". When you run Show-Command a graphical window appears where you can search for cmdlets, create predefined syntaxes and read the help of the cmdlet. Very cool and it makes your life as a scripter much easier.






Out-Gridview

With Out-Gridview you can export a table or list to a graphical window called the GridView. Within GridView you can then Filter your output to narrow your results.

Example syntax: Get-Process | Out-GridView

Easy insert

I always had problems inserting a cmdlet parameter after you created a oneliner. You couldn't do it. In Powershel v3 you now can. Just simply go to the place where you want to insert your parameter type - and the parameter name et voila.

Module Auto-Loading

You now can just type in the cmdlet of a module that is not loaded into the runtime. This is very handy if you forget to import de module.

As you can see below only two modules have been loaded:

Next I type (for example) the cmdlet Add-VpnConnection and I auto complete by hitting the TAB key.

Now when I type in get-module again, you can see the module where the Add-VpnConnection cmdlets resides is automatically added.