PowerShell / PowerShell/platyPS

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

Open
#817 0 comments 0 reactions 1 assignee View on GitHub

@adityapatwardhan is already working on this.

Since Oct 27, 2025.

Area-MAML
Dominant language
C#
Stars
871
Forks
166
Avg merge
21h 17m
Merged PRs (30d)
1

Description

Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • 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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.