Skip to content

INPUTS/OUTPUTS from comment-based help always get a {{ Fill in the Description }} placeholder #856

Description

@bravo-kernel

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-Outputs {
    <#
        .SYNOPSIS
            A synopsis.
        .DESCRIPTION
            A description.
        .OUTPUTS
            System.IO.FileInfo

            One file object for each generated file.
    #>
    [CmdletBinding()] param()
}
'@ | Set-Content Outputs.psm1

Import-Module ./Outputs.psm1
New-CommandHelp -CommandInfo (Get-Command Test-Outputs) |
    Export-MarkdownCommandHelp -OutputFolder . -Force

Expected behavior

## OUTPUTS

### System.IO.FileInfo

One file object for each generated file.


No placeholder when the help block already describes the type.

Actual behavior

## OUTPUTS

### System.IO.FileInfo

One file object for each generated file.

{{ Fill in the Description }}


The placeholder is appended even though the help *does* describe the type. Related quirk: the type line is comma-split as a type list, so a description like `One file object, ready for processing.` is silently truncated at the comma.

The placeholder is appended even though the help *does* describe the type: Get-Help returns the entire `.OUTPUTS` block as the type **name**, so the `description` field the transform inspects is always empty for comment-based help. Related quirk: the type line is comma-split as a type list, so a description like `One file object, ready for processing.` is silently truncated at the comma.

Error details

No error thrown.

Root cause: Get-Help returns the entire `.OUTPUTS` block as the type **name**, so the `description` field the transform inspects is always empty for comment-based help.

Suggested fix: when the returnValue description is empty, treat the lines following the first line of the type-name blob as the description and only emit the placeholder when nothing remains; only comma-split segments that look like type names (no whitespace).

Environment data

- Microsoft.PowerShell.PlatyPS 1.0.2
- PowerShell 7.5.8

Version

1.0.2

Visuals

No response

Additionally

Found while migrating Alt3.Docusaurus.Powershell to the v2 pipeline; downstream tracking: alt3/Docusaurus.Powershell#249

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions