PowerShell Basics: Meet About - The Owner’s Manual for PowerShell
Published Jun 06 2019 04:09 AM 19.7K Views
Microsoft

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!

 

Using About_

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_PSReadLine                  HelpFile
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 to create and manage scheduled jobs.
about_Scheduled_Jobs_Troublesh... HelpFile                            Explains how to resolve 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 to the 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:

PS C:\Users\mibender> get-help about_

Name                              Category  Module                    Synopsis
----                              --------  ------                    --------
about_PSReadLine                  HelpFile
about_Aliases                     HelpFile
about_Alias_Provider              HelpFile
about_Arithmetic_Operators        HelpFile
about_Arrays                      HelpFile
about_Assignment_Operators        HelpFile
about_Automatic_Variables         HelpFile
about_Break                       HelpFile
about_Certificate_Provider        HelpFile
about_CimSession                  HelpFile
about_Classes                     HelpFile
about_Command_Precedence          HelpFile
about_Command_Syntax              HelpFile
about_Comment_Based_Help          HelpFile
about_CommonParameters            HelpFile
about_Comparison_Operators        HelpFile
about_Continue                    HelpFile
about_Core_Commands               HelpFile
about_Data_Sections               HelpFile
about_Debuggers                   HelpFile
about_Do                          HelpFile

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:

PS C:\Users\mibender> get-help about_reg*

Name                              Category  Module                    Synopsis
----                              --------  ------                    --------
about_Registry_Provider           HelpFile
about_Regular_Expressions         HelpFile

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

Short description

Describes regular expressions in Windows PowerShell.

Long description

  [!NOTE] This article will show you the syntax and methods for using
  regular expressions in PowerShell, not all syntax is discussed. For a
  more complete reference, see the Regular Expression Language - Quick
  Reference.

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.

-   Select-String
-   -match and -replace operators
-   -split
-   switch statement with -regex option

PowerShell regular expressions are case-insensitive by default. Each method
shown above has a different way to force case sensitivity.
...

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.

 

about-vscode.png

 

 

 

Next time you run into a question on how to do something in PowerShell, check about_ before going to your favorite search engine.

 

Looking for more information on getting started with PowerShell? Check out my blog post on Finding Your Way In Powershell

 

Not Using PowerShell Core yet? Get started by downloading it from The PowerShell source on Github

 

Want even more PowerShell? Head over to The PowerShell docs at docs.microsoft.com

 

Want to get started using Visual Studio Code? Download VS Code and get started using it as your code editor

1 Comment
Version history
Last update:
‎Jun 06 2019 04:09 AM
Updated by: