Summary: Guest blogger, Tim Warner, talks about using Windows PowerShell conceptual Help.
Microsoft Scripting Guy, Ed Wilson, is here. Welcome back Timothy Warner as our guest blogger today.
Tim is an author and evangelist for Pluralsight, a premier online IT pro and development training company. Tim is the author of Windows PowerShell in 24 Hours, Sams Teach Yourself, a contributor at PowerShell.org, and co-organizer of the Nashville PowerShell User Group.
Like the good PowerSheller you are, you update your local Help and examine the full Select-String documentation in a separate window:
Get-Help –Name Select-String –ShowWindow
Now browse to the bottom of the file to the Related Links section. This is what you’ll see:
Online Version: http://go.microsoft.com/fwlink/p/?linkid=294008
What the heck are these “about_” entries? As a tech trainer, one of my great joys is seeing my students’ eyes light up with new understanding. To that point, I’ve taught so many IT pros who knew about Get-Help but had no idea about conceptual Help. Let’s get enlightened, shall we?
About “About” Help
Whereas “normal” PowerShell Help gives you syntax and usage explanations on a command-by-command basis, the PowerShell conceptual Help library focuses on the underlying, broader principles.
Let’s start by generating a report of all conceptual Help. Don’t forget to run Update-Help to make sure you have the latest and greatest documentation:
Get-Help -Name about_* | Select-Object -Property Name, Synopsis | Sort-Object -Property Name | Format-Table -AutoSize | Out-File -FilePath ‘~\Desktop\about_help.txt’
For instance, if you need to learn more about how to use the –match comparison operator for use in regex parsing, you can read the conceptual Help first:
Help about_comparison_operators -ShowWindow
Get-Help vs. Help
While we’re on the topic of PowerShell Help, some of you may have wondered why PowerShell includes two Help commands: Get-Help and Help.
You probably noticed that running Help <command> in the PowerShell console shows you a screen full of information at a time. You have the following options:
- Press the Space bar to advance one screen at a time.
- Press ENTER to reveal one line at a time.
- Press CTRL+C to break out of Help.
Try the following commands in a console session:
Get-Help Get-ChildItem -Full
Help Get-ChildItem -Full
Note Help works only in the Windows PowerShell console, and not the PowerShell Integrated Scripting Environment (ISE).
Let me show you what’s going on by revealing a tiny bit of the source code behind the Help function:
Get-Content –Path Function:\Help
Get-Help @PSBoundParameters | more
See that? When you run Help, PowerShell actually makes a call to Get-Help, passes your command argument, and pipes it to the More command.
Those Windows PowerShell team members are a crafty bunch, aren’t they? Let me leave you with some additional Help-related resources for your studying pleasure:
Thanks for reading, and I hope you have a great day or night, wherever you are in the world.
Thanks for this “Help”ful information, Tim!
I invite you to follow me on Twitter and Facebook. If you have any questions, send email to me at firstname.lastname@example.org, or post your questions on the Official Scripting Guys Forum. See you tomorrow. Until then, peace.
Ed Wilson, Microsoft Scripting Guy