Edit

Share via


Test-MarkdownCommandHelp

Tests the structure of a Markdown help file.

Syntax

Item

Test-MarkdownCommandHelp
    [-Path] <string[]>
    [-DetailView]
    [<CommonParameters>]

Literal

Test-MarkdownCommandHelp
    -LiteralPath <string[]>
    [-DetailView]
    [<CommonParameters>]

Description

This command reads a Markdown help file and validates the structure of the help content by checking for the presence of required elements in the proper order. The command returns $true if the file passes validation. The DetailView parameter can be used to display more detailed validation information.

Examples

Example 1 - Test a Markdown help file

For this example, we test the structure of a Markdown Module help file. This test fails because the command expects to test a Markdown Command help file. The output shows the kind of information you can expect from the DetailView parameter.

Test-MarkdownCommandHelp .\v2\Microsoft.PowerShell.PlatyPS\Microsoft.PowerShell.PlatyPS.md -DetailView
Test-MarkdownCommandHelp
  Valid: False
  File: D:\Git\PS-Src\platyPS\v2docs\v2\Microsoft.PowerShell.PlatyPS\Microsoft.PowerShell.PlatyPS.md

Messages:
  PASS: First element is a thematic break
  FAIL: SYNOPSIS not found.
  FAIL: SYNTAX not found.
  FAIL: DESCRIPTION not found.
  FAIL: EXAMPLES not found.
  FAIL: PARAMETERS not found.
  FAIL: INPUTS not found.
  FAIL: OUTPUTS not found.
  FAIL: NOTES not found.
  FAIL: RELATED LINKS not found.

Parameters

-DetailView

Instructs the command to output detailed validation information.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-LiteralPath

Specifies a path to one or more command markdown files. The value of LiteralPath is used exactly as it's typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences.

For more information, see about_Quoting_Rules.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:PSPath, LP

Parameter sets

Literal
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Path

The path to the Markdown help file to test.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:True
DontShow:False

Parameter sets

Item
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

Outputs

Boolean

Microsoft.PowerShell.PlatyPS.MarkdownCommandHelpValidationResult