platyPS icon indicating copy to clipboard operation
platyPS copied to clipboard

Maml Help generated by Export-MamlCommandHelp does not reflect parameter aliases

Open teramako opened this issue 3 months ago • 0 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

function Test-Alias {
  param(
    [Parameter()]
    [Alias("a")] $Alias
  )
}
$cmdHelp = New-CommandHelp -CommandInfo (Get-Command Test-Alias)
$cmdHelp.Parameters.Aliases
$file = Export-MamlCommandHelp -CommandHelp $cmdHelp -OutputFolder /tmp -Encoding utf8NoBOM
Get-Content $file | ? { $_ -match "aliases" }

Parameter aliases are not reflected in the Maml help generated by Export-MamlCommandHelp, even though $cmdHelp.Parameters.Aliaes is correctly set to a.

Expected behavior

<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="Named" aliases="a">
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="0" aliases="a">

The important part is the aliases attribute in <command:parameters>. The aliases attribute in <command:syntaxItem> may be left at none.

Actual behavior

<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="Named" aliases="none">
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="0" aliases="none">

Error details


Environment data

PS> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.5.2
PSEdition                      Core
GitCommitId                    7.5.2
OS                             Ubuntu 24.04.3 LTS
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Version

1.0.1

Visuals

No response

teramako avatar Sep 08 '25 14:09 teramako