New-MarkdownCommandHelp command outputs wrong parameter value type
@adityapatwardhan is already working on this.
Since Oct 27, 2025.
Assessment
This issue has not been assessed yet.
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.
- Dominant language
- C#
- Stars
- 870
- Forks
- 166
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PowerShell/platyPS
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
PowerShell/platyPS#868 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PowerShell/platyPS#857 ·
-
Difficulty 3/5 Half a day Newbie friendliness 68/100
PowerShell/platyPS#867 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
PowerShell/platyPS#863 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
PowerShell/platyPS#862 ·
All issues in PowerShell/platyPS
Similar issues
-
bug priority: P2
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
[Docs] README/PRIVACY still name AppCenter although v1.5.6.0+ uses the Microsoft Store Services SDKOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Azure/azure-sdk-tools#17317 ·
Maintainers usually reply within 1 day
-
Test
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
Maintainers usually reply within 1 day