From the results of my last Powershell blog post (Get-Command and Get-Member), we should have a list of commands (cmdlets, aliases, etc).
But, how do we know what each cmdlet does? Or, what if we know how a command works but want to see some examples?
We need some more information about how to use those commands in more detail. Let’s learn more about the Get-Member cmdlet that we introduced last time by utilizing the tools built into Powershell.
Get-Help
Get-Help displays detailed information about how to use a command and any examples that may exist.
The basic syntax is pretty simple and straightforward.
Get-Help
In order to find out more about the Get-Member cmdlet, we type:
Get-Help Get-Member
This will give us some basic syntax and usage information about Get-Member as well as a brief description. Let’s introduce some of the parameters that give us even more information about the cmdlet that you’d like to know more about.
Get-Help -Examples
This will show usage examples for the cmdlet
Get-Help -Detailed
This will show more detailed information than the basic syntax
Get-Help -Full
This shows the entire help file relating to the cmdlet, including details/examples.
Get-Help -ShowWindow
This will show the full help file for a cmdlet in a new window. It includes a search box and a settings button to help you configure which information you want displayed.
Get-Help -Online
This will pull up the online help files for the cmdlet.
Note: If you find that you’re help files seem to be lacking, it’s possible that they’re not fully installed or up-to-date. In that case, run Powershell as an Administrator and type the cmdlet, Update-Help and it will update all the associated help files.)