MCPMag.com

Sign up for our newsletter.

I agree to this site's Privacy Policy.

Prof. Powershell

A Better View of PowerShell Help

Once you try the ShowWindow parameter in PowerShell 3's Get-Eventlog cmdlet, you'll turn less and less to Get-Help for that quick assist.

I am always telling students and IT Pros I run across in forums, to get in the habit of reading PowerShell help. There is a wealth of valuable information right at your fingertips. The help documentation is structured and well written, a few formatting quibbles aside.

In PowerShell 3 there is a hidden help feature I think you'll like. I say hidden because I think most people won't read the help to discover it! So I'll get you started.

Normally, we run Get-Help for a command, read it, then try it out. If we need to refer to help again we need to re-run the command. Of course, you could open a second console window to run help in. If you have PowerShell 2, you'll need to continue using this technique. But in PowerShell 3 we can display help in a pop-up window using the -ShowWindow parameter:

PS C:\> help get-eventlog -ShowWindow

Fig. 1 shows the complete help in a graphical window, and your prompt has been returned to you. Now you can look through help and still have access to your PowerShell session. Notice the Find field? You can now search through the help for a specific keyword. You don't even have to press Enter. Search starts as soon as you begin typing, and matches are highlighted (see Fig. 2).

ShowWindow's graphical view of PowerShell Help

Figure 1. Call up ShowWindow to get a graphical view of PowerShell Help. (Click image to view larger version.)

 

Keyword searches are highlighted

Figure 2. Keyword searches are highlighted as you begin typing what you're looking for. (Click image to view larger version.)

The help window is also customizable. Click Settings and you should get a window like Fig. 3.

Customization via settings

Figure 3. PowerShell Help can be customized further through these settings.

You can check the different help sections that you wish to see. Click OK to apply the changes. These settings will apply every time you use ShowWindow until you change them again.

The last nice feature, especially for my older students (myself included), is the ability to resize the window and font using the slider. These settings are also saved for the next time you use ShowWindow.

This is an incredibly handy feature because ShowWindow also works with About files:

PS C:\> help about_remote -showwindow

which makes it very easy to find relevant help information. In fact, the parameter should work for anything that has help content, including your own scripts and functions.

About the Author

Jeffery Hicks is a Microsoft MVP in Windows PowerShell, Microsoft Certified Trainer and an IT veteran with over 20 years of experience, much of it spent as an IT consultant specializing in Microsoft server technologies with an emphasis in automation and efficiency. He works today as an independent author, trainer and consultant. Jeff writes the popular Prof. PowerShell column for MPCMag.com and is a regular contributor to the Petri IT Knowledgebase and 4SysOps. If he isn't writing, then he's most likely recording training videos for companies like TrainSignal or hanging out in the forums at PowerShell.org. Jeff's latest books are Learn PowerShell 3 in a Month of Lunches, Learn PowerShell Toolmaking in a Month of Lunches and PowerShell in Depth: An Administrators Guide. You can keep up with Jeff at his blog http://jdhitsolutions.com/blog, on Twitter at twitter.com/jeffhicks and on Google Plus (http:/gplus.to/JeffHicks)

comments powered by Disqus

Reader Comments:

Sun, Dec 9, 2012 Dimitrios Kalemis Athens, Greece

Obviously, the author did not write the abstract (the subtitle that is under the title and occupies one-and-a-half line). That's because whoever wrote the abstract, completely missed the point of this article.

Wed, Dec 5, 2012 shawn B St. Louis, MO USA

I have a new favorite command

Add Your Comment Now:

Your Name:(optional)
Your Email:(optional)
Your Location:(optional)
Comment:
Please type the letters/numbers you see above