Skip to content

Honor [Parameter(DontShow)] in New-MarkdownCommandHelp output#846

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-dontshow-parameter-issue
Draft

Honor [Parameter(DontShow)] in New-MarkdownCommandHelp output#846
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-dontshow-parameter-issue

Conversation

Copy link
Copy Markdown

Copilot AI commented May 26, 2026

Microsoft.PowerShell.PlatyPS 1.0.1 was emitting hidden parameters in generated markdown even when parameters were annotated with [Parameter(DontShow)]. This change aligns New-MarkdownCommandHelp behavior with expected PowerShell metadata semantics by excluding hidden parameters from generated help.

  • What changed

    • NewMarkdownHelpCommand now sets TransformSettings.ExcludeDontShow = true when generating command help.
    • TransformBase now enforces ExcludeDontShow consistently in:
      • parameter collection (GetParameters)
      • syntax generation (GetSyntaxItem, both positional and named parameter passes)
  • Regression coverage

    • Added a focused Pester scenario in NewMarkdownHelp.Tests.ps1 that defines a function with:
      • one public parameter
      • two [Parameter(DontShow)] parameters
    • Asserts hidden parameters are absent from:
      • markdown parameter sections
      • imported command model parameter/syntax content
  • Example scenario covered

    function Test-DontShowParameter {
        [CmdletBinding()]
        param(
            [string]$Public,
            [Parameter(DontShow)][string]$Hidden,
            [Parameter(DontShow)][string]$Break
        )
    }
    
    New-MarkdownCommandHelp -Command (Get-Command Test-DontShowParameter) -OutputFolder $TestDrive
    # Expected: only -Public appears in generated help content

This change is Reviewable

Copilot AI changed the title [WIP] Fix Microsoft.PowerShell.PlatyPS not honoring [Parameter(DontShow)] Honor [Parameter(DontShow)] in New-MarkdownCommandHelp output May 26, 2026
Copilot AI requested a review from adityapatwardhan May 26, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Microsoft.PowerShell.PlatyPS 1.0.1 does not honor [Parameter(DontShow)]

2 participants