PowerShell / PowerShell/platyPS

New-MarkdownCommandHelp command outputs wrong parameter value type

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

@adityapatwardhan is already working on this.

Since Oct 27, 2025.

Needs-Triage
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

Wrong result is output when the parameter type is nested type from generic class like following:

System.Collections.Generic.Dictionary`2+Enumerator[System.Int32,System.Int64]
PS> function Test-Cmd {
>   param(
>     [Parameter()] [System.Collections.Generic.Dictionary`2+Enumerator[System.Int32,long]] $AAA
>   )
> }

PS> $cmd = Get-Command Test-Cmd

PS> $file1 = New-MarkdownCommandHelp -CommandInfo $cmd -Encoding utf8NoBOM -OutputFolder /tmp/A

PS> Get-Content $file1 | ? { $_ -match "^Test-Cmd|^Type" }

Test-Cmd [[-AAA] <Dictionary`2+Enumerator`2[int,long]>]
Type: System.Collections.Generic.Dictionary`2[System.Int32,System.Int64]

PS> $file2 = New-MarkdownCommandHelp -CommandInfo $cmd -Encoding utf8NoBOM -OutputFolder /tmp/B -AbbreviateParameterTypeName

PS> Get-Content $file2 | ? { $_ -match "^Test-Cmd|^Type" }
Test-Cmd [[-AAA] <Dictionary`2+Enumerator`2[int,long]>]
Type: Enumerator`2[System.Int32,System.Int64]

Expected behavior
FullParameterType
$file1 = New-MarkdownCommandHelp -CommandInfo $cmd -Encoding utf8NoBOM -OutputFolder /tmp/A
Get-Content $file1 | ? { $_ -match "^Test-Cmd|^Type" }
Expected Output:
Test-Cmd [[-AAA] <Dictionary`2+Enumerator[int,long]>]
Type: System.Collections.Generic.Dictionary`2+Enumerator[System.Int32,System.Int64]
AbbreviateParameterType
$file2 = New-MarkdownCommandHelp -CommandInfo $cmd -Encoding utf8NoBOM -OutputFolder /tmp/B -AbbreviateParameterTypeName
Get-Content $file2 | ? { $_ -match "^Test-Cmd|^Type" }
Expected Output:
Test-Cmd [[-AAA] <Dictionary`2+Enumerator[int,long]>]
Type: Dictionary`2+Enumerator[int,long]
Actual behavior
FullParameterType
$file1 = New-MarkdownCommandHelp -CommandInfo $cmd -Encoding utf8NoBOM -OutputFolder /tmp/A
Get-Content $file1 | ? { $_ -match "^Test-Cmd|^Type" }
Actual Output:
Test-Cmd [[-AAA] <Dictionary`2+Enumerator`2[int,long]>]
Type: System.Collections.Generic.Dictionary`2[System.Int32,System.Int64]
  • Syntax:
    • The trailing "`2" is not necessary.
  • Type:
    • "Enumerator" class name is missing.
AbbreviateParameterType
$file2 = New-MarkdownCommandHelp -CommandInfo $cmd -Encoding utf8NoBOM -OutputFolder /tmp/B -AbbreviateParameterTypeName
Get-Content $file2 | ? { $_ -match "^Test-Cmd|^Type" }
Actual Output:
Test-Cmd [[-AAA] <Dictionary`2+Enumerator`2[int,long]>]
Type: Enumerator`2[System.Int32,System.Int64]
  • Syntax:
    • The trailing "`2" is not necessary.
  • Type:
    • The nesting source class name "Dictionary" is missing.
    • Parameters of generic type are not abbreviated.

### Error details

```console

Environment data
PS> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.5.3
PSEdition                      Core
GitCommitId                    7.5.3
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

In particular, when using the -AbbreviateParameterTypeName parameter, I would like the output to be the same as the Get-Help command.

Image

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.