When I began to learn PowerShell, I asked a few experts in the field how they learned to use it with very few books or online references available at the time they began using it. Every one of them pointed to the about help files as the source for how things worked in PowerShell.
The about files provide detailed information on concepts and inner-workings of PowerShell, referred to as Conceptual Help articles. Each article begins with the about_ prefix. It covers concepts like loops, functions, and remoting, just to name a few. Like Get-Help and Get-Command, about is your built-in guidance for learning and using PowerShell. It should be the first place you look when you get stuck. Just like the owners manual for your car!
It is simple to get started. First, you want to see what about help files are available in PowerShell. So start with Get-help as seen here in PowerShell 6.2:
PS C:\Users\mibender> get-help about_
Name Category Module Synopsis
---- -------- ------ --------
about_Scheduled_Jobs HelpFile Describes scheduled jobs and explains how to u...
about_Scheduled_Jobs_Advanced HelpFile Explains advanced scheduled job topics, includ...
about_Scheduled_Jobs_Basics HelpFile Explains how tocreateand manage scheduled jobs.
about_Scheduled_Jobs_Troublesh... HelpFile Explains how toresolve problems with schedule...
about_ActivityCommonParameters HelpFile Describes the parameters that Windows PowerShell
about_Checkpoint-Workflow HelpFile Describes the Checkpoint-Workflow activity, which
about_ForEach-Parallel HelpFile Describes the ForEach -Parallel language const...
about_InlineScript HelpFile Describes the InlineScript activity, which run...
about_Parallel HelpFile Describes the Parallel keyword, which runs the
about_Sequence HelpFile Describes the Sequence keyword, which runs sel...
about_Suspend-Workflow HelpFile Describes the Suspend-Workflow activity, which...
about_WorkflowCommonParameters HelpFile This topic describes the parameters that are v...
about_Workflows HelpFile Provides a brief introduction tothe Windows
Notice that the list of about files is small here. That is because the help files in PowerShell 6.2 (aka PowerShell Core) were not updated since installation. This is a must do for anyone using Windows PowerShell or PowerShell Core. Simply run Update-Help to install all the About files and help for all installed cmdlets.
This will produce a longer list of available help files. I received back 130, but this may vary between systems and versions of PowerShell. About files are available in all versions of PowerShell and Windows PowerShell.
Here's the full list and how to get it again using get-help:
The name for the files is straight forward. It will be about_ and the name of the concept. For example, the about file for parameters is about_Parameters. Knowing this, you can use basic PowerShell search skills to find what you are looking for.
Let's say you want to find out how to work with Regular expressions in PowerShell. You start with a basic search using get-help and a partial name:
Now to view the entire About file, enter the full name of 'about_regular_expression'. Tab-Complete will work for this as well, so you can always use that technique to limit keystrokes. Check out this doc on tab completionfor more details on its usage
PS C:\Users\mibender> get-help about_Regular_Expressions
ABOUT REGULAR EXPRESSIONS
Describes regular expressions in Windows PowerShell.
[!NOTE] This article will show you the syntax and methods forusing
regular expressions in PowerShell, not all syntax is discussed. For a
more complete reference, see the Regular Expression Language - Quick
A regular expression is a pattern used to match text. It can be made up of
literal characters, operators, and other constructs.
This article demonstrates regular expression syntax in PowerShell.
PowerShell has several operators and cmdlets that use regular expressions.
You can read more about their syntax and usage at the links below.
- -match and -replace operators
- switch statement with -regex option
PowerShell regular expressions are case-insensitive bydefault. Eachmethodshownabovehasadifferentwaytoforcecasesensitivity.
When you dig into the About file, you find a ton of useful information for using Regular expressions, or whatever it is you are interested in. This should be your first-stop when learning about new features and how PowerShell Works.
Maybe you use Visual Studio Code (aka VS Code) and the integrated terminal using the PowerShell extension for VS Code? No Problem! About is available there as well since VS Code using the underlying PowerShell installations.
Next time you run into a question on how to do something in PowerShell, check about_ before going to your favorite search engine.