Practical PowerShell PowerShell Help – PowerShell

Help – PowerShell

Dealing with PowerShell on a daily basis, I query the help for a lot of cmdlets every day. This mean looking at syntax, examples, parameters and switches for a cmdlet. There is quite a lot that can be revealed from good help in PowerShell.

Did you know that you can type in ‘Help’ to get more information on PowerShell’s help functionality? By typing in this one cmdlet, we can reveal a lot of relevant information about help.

Help


What we see is that there are quite a few things that can be revealed with this. We learn that we can update the help topics using Update-Help. We do this because sometime the help information for PowerShell has been updated. In fact on a default install of PowerShell 7.0, I noticed that help for some cmdlets seemed a bit off, so I just ran a ‘quick’ Update-Help to download the latest information from Microsoft. This cleared up the missing help information and I was able to find what I needed.

Update Help (visual)

This update will cycle thorough all the modules to make sure the help for that module is up to date. Depending on your machine Internet speed, etc. this may take some time to complete. We also see that there are different techniques for getting help for a particular cmdlet. We have Option (1):

[sourcecode language=”powershell”]
Get-AzVM -Q
[/sourcecode]
Option 2:
[sourcecode language=”powershell”]
Get-Help Get-AzVM
[/sourcecode]
Either will provide the basic help for a cmdlet. Always use ‘Get-Help -Full’ for complete help information. There is a third option, which displays the help for a cmdlet in page by page format:
[sourcecode language=”powershell”]
Help Get-AzVM
[/sourcecode]
This method displays the entire help, as if we added the ‘-Full’ switch to Get-Help for a cmdlet.

Lastly, we can get the online Microsoft Docs version of help if we need that as well:
[sourcecode language=”powershell”]
Get-Help Get-AzVM -Online
[/sourcecode]
Caveat here is that not all cmdlets have a page set up for this, or the link provided is broken. So YMMV.

Related Post