Prof. Powershell
Help Wanted
PowerShell, at version 2, takes help to another level.
- By Jeffery Hicks
- 07/24/2009
PowerShell has always been one of the easier Microsoft management products to learn on your own because of its help system. Don't know what to do with Get-Service? Ask for help:
PS C:\> Help get-service
The help system also accepts wildcards so all you need is at least part of the topic:
PS C:\> help *wmi*
PowerShell 2.0 takes help to another level. Of course there is refined help documentation for just about everything. But the best improvement is the link to online help. We no longer have to wait for updates or service packs to update the help files. The most up-to-date information and examples can be found online. When you run a command like this:
PS C:\test> help Get-WSManCredSSP
You'll see a reference link to online help:
RELATED LINKS
Online version: http://go.microsoft.com/fwlink/?LinkId=141443
Connect-WSMan
...
If you copy and paste the link into your browser, you'll be taken to the most current Technet documentation for the cmdlet or topic. But you don't even have to do that. Use the -online parameter:
PS C:\test> help Get-WSManCredSSP -online
PowerShell will automatically open the online link with your default browser -- no copy and paste required. You can use the same syntax in the PowerShell Integrated Scripting Environment (ISE), sometimes referred to as graphical PowerShell.
In the online help all of the examples and code samples can easily be copied with a single click. You can paste them into your PowerShell window with a right click or into your scripting editor. The copied code includes a prompt, so you'll need to tweak the line before you execute it.
If you use the ISE, the variable $psise.options.UseLocalhelp, can be changed so that when you press F1, you'll get the online help from Technet. Change the variable in the ISE like this:
$psise.options.uselocalhelp=$false
To make the change permanent you'll need to add this line to your ISE profile. PowerShell MVP Shay Levy has a very nice article on help in the ISE including some useful functions which you can find here.
Note: This information is based on pre-release software and is subject to change.
About the Author
Jeffery Hicks is an IT veteran with over 25 years of experience, much of it spent as an IT infrastructure consultant specializing in Microsoft server technologies with an emphasis in automation and efficiency. He is a multi-year recipient of the Microsoft MVP Award in Windows PowerShell. He works today as an independent author, trainer and consultant. Jeff has written for numerous online sites and print publications, is a contributing editor at Petri.com, and a frequent speaker at technology conferences and user groups.