platyPS icon indicating copy to clipboard operation
platyPS copied to clipboard

Export-MamlCommandHelp isn't showing pipeline input correctly

Open sdwheeler opened this issue 4 months ago • 1 comments

Prerequisites

  • [x] Write a descriptive title.
  • [x] Make sure you are able to repro it on the latest version
  • [x] Search the existing issues.

Steps to reproduce

The Name parameter of Get-Command accepts pipeline input. The markdown shows this correctly.

get-help Get-Command -Parameter Name

-Name [<System.String[]>]
    Specifies an array of names. This cmdlet gets only commands that have the specified name. Enter a
    name or name pattern. Wildcard characters are permitted.

    To get commands that have the same name, use the **All** parameter. When two commands have the same
    name, by default, `Get-Command` gets the command that runs when you type the command name.

    Required?                    false
    Position?                    0
    Default value
    Accept pipeline input?       false
    Aliases                      none
    Accept wildcard characters?  true

Steps to reproduce.

$c = Import-MarkdownCommandHelp .\reference\7.5\Microsoft.PowerShell.Core\Get-Command.md
$c | Export-MamlCommandHelp -OutputFolder test -Force
show-helpPreview -Path .\test\Microsoft.PowerShell.Core\Microsoft.PowerShell.Core-Help.xml

Expected behavior

get-help Get-Command -Parameter Name

-Name [<System.String[]>]
    Specifies an array of names. This cmdlet gets only commands that have the specified name. Enter a
    name or name pattern. Wildcard characters are permitted.

    To get commands that have the same name, use the **All** parameter. When two commands have the same
    name, by default, `Get-Command` gets the command that runs when you type the command name.

    Required?                    false
    Position?                    0
    Default value
    Accept pipeline input?       true
    Aliases                      none
    Accept wildcard characters?  true

Actual behavior

get-help Get-Command -Parameter Name

-Name [<System.String[]>]
    Specifies an array of names. This cmdlet gets only commands that have the specified name. Enter a
    name or name pattern. Wildcard characters are permitted.

    To get commands that have the same name, use the **All** parameter. When two commands have the same
    name, by default, `Get-Command` gets the command that runs when you type the command name.

    Required?                    false
    Position?                    0
    Default value
    Accept pipeline input?       false
    Aliases                      none
    Accept wildcard characters?  true

Error details


Environment data

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     1.0.1                 Microsoft.PowerShell.PlatyPS        {Compare-CommandHelp, Export-MamlCommandHelp, Exp…

Version

v1.0.1

Visuals

No response

sdwheeler avatar Aug 19 '25 13:08 sdwheeler

To be more precisely I would say that expected behavior should be as the following:

Get-Help Get-Command -Parameter Name

-Name <System.String[]>
    Specifies an array of names. This cmdlet gets only commands that have the specified name. Enter a name or name pattern. Wildcard characters are permitted.

    To get commands that have the same name, use the All parameter. When two commands have the same name, by default, `Get-Command` gets the command that runs when you type the command name.

    Required?                    false
    Position?                    0
    Default value                None
    Accept pipeline input?       True (ByPropertyName, ByValue)
    Accept wildcard characters?  true

aptiv-marcin avatar Aug 20 '25 10:08 aptiv-marcin