Forum Discussion
Accept pipeline input?
The off-line help files of all parameters of all cmdlets have the answer False to the question in the title. This is confusing and wrong.
And since I'm at it: the 3rd and 4th syntax item of the off-line help file of Get-Help miss the parameters -Examples, -Parameters, respectively (compared to the syntax items of the on-line help).
I'm a learner of PowerShell and find it tiresome that the off-line help is unreliable and that I have to go to the online help so often.
I use Windows PowerShell version 5.1.26100.8457
2 Replies
You're right to notice differences between the offline help and the online help — and what you're seeing is very common on a default installation of Windows PowerShell 5.1.
By default, the local help files are extremely minimal.
If you haven't updated them yet, running:
Update-Help -Forceusually improves things a lot (more examples, more parameter descriptions, more complete syntax).
That said, some modules never published full help files, so the offline help will never be 100% complete.
A few useful points:
- Get-Command -Syntax is the most reliable source for the actual structure of a cmdlet (parameter sets, mandatory parameters, pipeline support, etc.).
- Get-Help -Online is usually the most complete documentation, but it sometimes reflects PowerShell 7.x instead of 5.1.
- Offline Get-Help is helpful, but only after Update-Help, and even then some gaps remain.
If you can share which cmdlets you're checking, we can look at the pipeline metadata together and see whether the behavior comes from the cmdlet itself or from the help files.
- BosjabouterOccasional Reader
Charlie34000. Thank you for your comments. I ran (in admin mode) Update-Help -Force. This did not make any difference (I had run the command without -Force earlier).
I have written notes about PowerShell meant for colleagues and students. In the notes I explain the different parameter sets with the six sets of Get-Help as an example. At the time of writing, the off-line help files were correct. What am I supposed to do? Rewrite the notes and refer to Get-Command -Syntax or to the online help with the chance that after the next Windows update the help files (and my notes) are correct again?
In the notes I also explain the possibility of input through the pipeline vs. -InputObject (or a similar parameter). I explain in some detail how to arrive at the one-liner:
Get-Help Get-C* | % {Write-Host `n $_.name; Get-Help $_.name -Parameter * -ea 0 | % {Write-Host (" Pos: {0,6:s} Pipe_inp: {1,6:s} " -f $_.position, $_.pipeLineInput), (" Parameter name: {0,1:s}" -f $_.name) } }At the time I wrote this, it gave a correct table. Do I now discard this one-liner and the discussion leading to it? Again, with the chance that it will be correct again in the near future?
All-in-all, this business of help files comes across as amateurish. I find it rather unexpected, since PowerShell is after all an important software package promoted (and supported?) by one the most valuable companies in the world.