Why does the help file say ‘Accept pipeline input?’ is false for all commands?

0
27
Asked By MightyTurtle23 On

I'm facing an odd problem where the help files for various commands are indicating that all parameters have the 'Accept pipeline input?' property set to false. This situation persists across multiple help files, even for commands that I know accept pipeline input. For instance, when I use the command 'get-command -module', it works fine with pipeline input, yet the help file misreports this. Has anyone experienced this issue or found a way to resolve it?

3 Answers

Answered By TechGuru42 On

This issue is stemming from a bug in the tool used to create the MAML help files accessed via `Get-Help`. There’s an open issue on GitHub related to it which you can look into: [Issue #804: Export-MamlCommandHelp isn't showing pipeline input correctly](https://github.com/PowerShell/platyPS/issues/804). Basically, the PowerShell Docs team uses `PlatyPS` to convert their markdown files into the MAML format. The current MAML version has this bug, which is why the help files report 'Accept pipeline input?' incorrectly. Just wait for the bug fix, and then run `Update-Help` for the latest info.

InfoSeeker34 -

*For the commands they've provided a correct help URI for, the rest might not be fixed anytime soon. Just a heads up!

InfoSeeker34 -

Great catch, thanks for the info! I'll bookmark this.

Answered By CuriousCoder101 On

It seems like this might just be a glitch in the documentation. A good workaround is to check the actual command metadata instead of relying on the help files. You can use this command to display all parameter sets and look for the properties 'ValueFromPipeline' and 'ValueFromPipelineByPropertyName': `Get-Command Set-NetIPAddress | foreach {$_.ParameterSets | foreach {$_.Name | Out-Host; $_.Parameters | ft -AutoSize | Out-Host}}`. Wrapping this in a function will make it easier to call every time.

HelpfulPal92 -

This workaround is super helpful. I'll try it out while I look for a long-term fix. Thanks!

Answered By StaticWatcher77 On

When I run the command:
```powershell
Get-Help Get-Command -Parameter Module
```
I actually get a different output that shows 'Accept pipeline input?' as true (ByPropertyName). So I can't replicate the issue you're having. Maybe there's something specific to your setup that's causing this?

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.