Dia's Test Post
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. Let’s say you need to identify and extract all email addresses from a huge text file. To solve the issue, you decide to employ the Select-String cmdlet with regular expression (regex) syntax. 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
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 ‘~Desktopabout_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
Thanks for reading, and I hope you have a great day or night, wherever you are in the world. ~Tim 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 email@example.com, or post your questions on the Official Scripting Guys Forum. See you tomorrow. Until then, peace. Ed Wilson, Microsoft Scripting Guy