PowerShell / PowerShell/platyPS

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

Open
#856 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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-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: https://github.com/alt3/Docusaurus.Powershell/issues/249

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.

Research direction

Start by reproducing the issue with New-CommandHelp and Export-MarkdownCommandHelp using the provided Outputs.psm1 example. Trace how comment-based .OUTPUTS content becomes the generated Markdown, then verify that an existing description does not receive a placeholder and that comma-containing descriptions are preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
documentation, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.