Pages

PowerShell Get-Help and Update-Help

As a lot of system, database and network administrators are transitioning from VBScript to PowerShell or learning PowerShell to automate administration tasks for the first time, it is common to run into a new or unfamiliar PowerShell cmdlets that may be useful in your tasks. Get-Help cmdlets could be one of the most effective learning assistant.

There are multiple sources you can get information on PowerShell cmdlets properties, functionalities and even examples. Microsoft TechNet provides abundant information of its usage. For example for Add-Member Cmdlet. This Microsoft TechNet page provides details of its properties, methods as well as examples. Another way of getting this information is using Get-Help cmdlet. 

Using Get-Help PowerShell cmdlet display all this information about the cmdlet you are interesting right at the PowerShell window without going to the website. Like the example above, we could use 

Get-Help Add-Member

to find out all the details about Add-Member cmdlet.

However, if you have been using older version of PowerShell or trying to find details on a newer cmdlet, you may encounter message that Get-Help cannot find the help files for this cmdlet on this computer.


All you need to do is execute a

Update-Help

PowerShell command and it will download all necessary files in the background.


Execute the Get-Help command again and you would see the all the details on Add-Member. If you notice, the above screen shot has a -Examples property for Get-Help cmdlet. This lists out examples of using Add-Member. I found this feature very useful.

You may also see I use 'help' instead of 'Get-Help' as the command. 'help' is the alias of 'Get-Help' and make scripting simpler. You can find a list of alias with

Get-Alias

Funny thing is 'help' is not included in the alias list.. but you get the idea.

Now you know about Get-Help PowerShell cmdlet, hopefully it could be a great assistance for your PowerShell learning and scripting.

2 comments:

  1. > Funny thing is 'help' is not included in the alias list..

    HELP isn't quite an alias - it is the result of a lookup rule. When you type a cmdlet and we can't find it, just before we give you an error, we first put a "get-" in front of it and try that. Take a look at any of the GET-xxx cmdlets and try it yourself.

    Jeffrey Snover [MSFT]
    Distinguished Engineer and Lead Architect for Windows Server

    ReplyDelete
    Replies
    1. Jeffrey, thanks for pointing that out. Didn't know that is the result of lookup rule. Did try a few 'get' cmdlets like 'module' and 'counter', and it returns the similar results as with the 'get-module' and 'get-counter'. However I couldn't get the 'process' to work in similar behavior, does this rule has some exception?

      Delete