Archive

Archive for January, 2017

How to work with PowerShell “Get-Help”

January 27, 2017 Leave a comment

I thought I would write a simple post on how to best get the most out of “help” in PowerShell.

PowerShell CLI

Ways to access help. Try the following at a PowerShell CLI prompt to see how it works.

PS >help Get-Job
PS >help Wait-Job -Full
Ps > help Wait-Job -Examples
PS > help Get-Job -ShowWindow
PS >help help Get-Job -Online


These are the basic help modes. TO learn about other options for customizing help output do the following:

Help help -ShowWindow

In PowerShell ISE these commands work the same in the command Window. We can also get an alternate form of help with the “command builder” add-on panel. Go to the “help” menu item and select “Show Command Window” or type Show-Command in the command window. You will see the following. You can start typing any command or portion and the command list will be filtered.

Here is the screen that builds a command. You can see it is organized in a way that helps us to break a command down into areas of interest (ParameterSets) as well as creating the finished command and parameters for us. This is very useful with very complex commands with dozens of parameters.

More Advanced Help

Other useful methods of learning and understanding PowerShell commands are:

Get-Command
Get-Module
Get-Member

These can be used to inspect any command or any module in detail. Use what you have learned about help to get the detailed help on these commands to see how they are fundamental to the effective use of PowerShell.

Sapien PowerShell Studio

In PSS we can highlight any command and use the context menu to get help. This gives a collapsible pane that show a nicely formatted full text help. It is useful for quickly looking up a parameter or an example.

Of course, PSS also has a link to the online “Spotlight on Controls” and to the newer online “Knowledge Center” available in the “Toolbox” and on the main menus. It is worth learning how to find and use these resources. Sapien has even included links the MSDN documentation for the controls.

When in the edit pane the object browser also has context men selections for both the normal help pane and online help for the selected command.

Sapien products are available here: http://www.sapien.com

The Sapien scripting community forums are at: http://www.scriptinganswers.com

Finally

To be effective with PowerShell it is absolutely critical to learn how to use the help tools provided. Too many users try to use PowerShell in advanced ways with little understanding of how to approach the issue or how to find and use commands. The PowerShell team has made this easier than most software system have in the past. They have also forever changed the way technical products will deliver documentation.

Advertisements
Categories: Uncategorized