Don’t be surprised by the Help bug

by Nov 10, 2009

Get-Help is great for discovering cmdlet and function syntax but sometimes it fails on PowerShell v.2. Take a look at this:

Get-Help Enable-PSRemoting
Get-Help Disable-PSRemoting

When you run both lines in PowerShell v.2, only the first one will retrieve detailed Help. Now, try closing PowerShell and re-open it. Reverse the order, and try again. This time, try only the first line to get Help. Strange, huh?

Looking at both commands, you will see that Disable-PSRemoting is a function whereas Enable-PSRemoting is a cmdlet. Both use the same Help file (System.Management.Automation.dll-Help.xml). Unfortunately, PowerShell can only get Help information for either cmdlets or for scripts/functions. So, when you look up Help information for a function, PowerShell can no longer get Help information for cmdlets in that file.

The lesson learned: do not combine Help information for both functions and cmdlets in the same Help file.

Twitter This Tip! ReTweet this Tip!