Skip to content

📖 [Docs]: .INPUTS and .OUTPUTS format rules added to PowerShell function help standards#65

Merged
Marius Storhaug (MariusStorhaug) merged 8 commits into
mainfrom
feat-ps-inputs-outputs-help-format
Jul 25, 2026
Merged

📖 [Docs]: .INPUTS and .OUTPUTS format rules added to PowerShell function help standards#65
Marius Storhaug (MariusStorhaug) merged 8 commits into
mainfrom
feat-ps-inputs-outputs-help-format

Conversation

@MariusStorhaug

@MariusStorhaug Marius Storhaug (MariusStorhaug) commented Jul 25, 2026

Copy link
Copy Markdown
Member

PowerShell comment-based help standards now include precise rules for writing .INPUTS and .OUTPUTS — covering pipeline-only scope, fully-qualified .NET type names, the two-line type + description format, the None template, per-type keyword repetition, and how PlatyPS renders these sections.

New: .INPUTS and .OUTPUTS formatting rules

The PowerShell Functions coding-standards page gains a dedicated sub-section under Comment-based help (required) that specifies exactly how to write these two sections:

  • .INPUTS covers pipeline input only — not all parameters. Use None (as the type name) with You can't pipe objects to <CommandName>. as the description when no pipeline input is accepted.
  • .OUTPUTS must match [OutputType()]. Repeated once per return type for multi-type functions.
  • Both use the fully-qualified .NET type name (System.String, not [string]).
  • Two-line format: type name alone on the first line, description indented on the next line. Putting both on one line causes MD026 (trailing period in headings) violations in PlatyPS-generated docs, since PlatyPS renders the type name as a ### heading.
  • The keyword is repeated once per type when multiple types are accepted or returned.

Technical Details

  • Single file changed: src/docs/Coding-Standards/PowerShell/Functions.md
  • Insertion after the existing paragraph in the Comment-based help (required) section; no existing content modified.
  • Corrected from initial single-line System.String. Description. format after discovering the PlatyPS MD026 constraint.
Related issues

…ards

Document pipeline-input-only scope of .INPUTS, fully-qualified .NET type
name convention for both sections, the 'None.' template when no pipeline
input is accepted, per-type repetition of the keyword, and the PlatyPS
single-line constraint.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
PlatyPS renders the type name as a ### heading - putting type and description
on one line causes trailing-period MD026 violations in generated docs.
Canonical format: type name alone on first line, description indented on
the next line.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Update the Get-UserData snippet to use the two-line format, add the
missing .INPUTS None block, and replace [PSCustomObject] with the
fully-qualified System.Management.Automation.PSCustomObject type
in both the comment-based help and [OutputType()].

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Official about_Comment_Based_Help and PowerShell/PowerShell source both
use 'TypeName. Description.' on one line - not a two-line type/description
split. Also revert [OutputType] to [PSCustomObject] (type literal, no
full namespace needed in the attribute).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
PlatyPS 1.0.3 renders the first line of each .INPUTS/.OUTPUTS entry as
a ### heading. Single-line 'TypeName. Description.' creates trailing-period
MD026 violations and puts a full sentence in a heading. Two-line with
indented description renders the description as a code block (4 spaces).

Correct format for PlatyPS-based modules: type name only, no period, no
inline description. Description goes in the generated markdown file.

Also note the divergence from about_Comment_Based_Help single-line examples
which work fine in Get-Help but not PlatyPS.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
PlatyPS v2 test confirms: type on first line, blank line, description as
paragraph produces the cleanest markdown (clean ### heading, body text
below). Update both the guidance section and the Get-UserData example.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Show the blank-line format in the Rotate-Secret.ps1 code example,
aligning Scripts with the Functions guidance.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

1 participant