Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/MarkdownReader/CommandHelpMarkdownReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ internal static string GetDescriptionFromMarkdown(ParsedMarkdownContent markdown
diagnostics.Add(new DiagnosticMessage( DiagnosticMessageSource.Description, "DESCRIPTION header found", DiagnosticSeverity.Information, "DESCRIPTION", markdownContent.GetTextLine(start)));
markdownContent.Seek(start);
markdownContent.Take();
var end = markdownContent.FindHeader(2, string.Empty);
var end = markdownContent.FindHeader(2, "EXAMPLES");
return markdownContent.GetStringFromAst(end).Trim();
}

Expand Down
10 changes: 10 additions & 0 deletions test/Pester/ImportMarkdownCommandHelp.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -251,4 +251,14 @@ Describe 'Import-MarkdownCommandHelp Tests' {
$ch.Syntax[$offset].ToString() | Should -Be $string
}
}

Context 'Validate Description' {
BeforeAll {
$ch = Import-MarkdownCommandHelp "$PSScriptRoot/assets/Compare-CommandHelp.md"
}

It "Should handle empty description" {
$ch.Description | Should -BeNullOrEmpty
}
}
}
69 changes: 19 additions & 50 deletions test/Pester/assets/Compare-CommandHelp.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,45 @@
---
document type: cmdlet
title: Compare-CommandHelp
external help file: Microsoft.PowerShell.PlatyPS.dll-Help.xml
HelpUri: ''
Locale: en-US
Module Name: Microsoft.PowerShell.PlatyPS
Locale: "en-US"
ms.date: 03/07/2025
PlatyPS schema version: 2024-05-01
HelpUri:
ms.date: 05/20/2024
external help file: Microsoft.PowerShell.PlatyPS.dll-Help.xml
title: Compare-CommandHelp
---

# Compare-CommandHelp

## SYNOPSIS

{{ Fill in the Synopsis }}

## SYNTAX

### __AllParameterSets

```
Compare-CommandHelp [-Reference] <CommandHelp> [-Difference] <CommandHelp>
[-PropertyNamesToExclude <String[]>] [<CommonParameters>]
Compare-CommandHelp [-ReferenceCommandHelp] <CommandHelp> [-DifferenceCommandHelp] <CommandHelp>
[-PropertyNamesToExclude <string[]>] [<CommonParameters>]
```

## ALIASES

This cmdlet has the following aliases,
{{Insert list of aliases}}

## DESCRIPTION

{{ Fill in the Description }}

## EXAMPLES

### My Example

description

```powershell
PS> write-output hi
hi
```

description 2

```powershell
PS> echo bye
bye
```

description 3
### Example 1

## PARAMETERS

### -Difference
### -DifferenceCommandHelp

```yaml
Type: CommandHelp
Type: Microsoft.PowerShell.PlatyPS.Model.CommandHelp
DefaultValue: ''
Globbing: false
SupportsWildcards: false
ParameterValue: []
Aliases: []
ParameterSets:
Expand All @@ -77,12 +56,10 @@ HelpMessage: ''

### -PropertyNamesToExclude

{{ Fill PropertyNamesToExclude Description }}

```yaml
Type: String[]
Type: System.String[]
DefaultValue: ''
Globbing: false
SupportsWildcards: false
ParameterValue: []
Aliases: []
ParameterSets:
Expand All @@ -97,14 +74,12 @@ AcceptedValues: []
HelpMessage: ''
```

### -Reference

{{ Fill Reference Description }}
### -ReferenceCommandHelp

```yaml
Type: CommandHelp
Type: Microsoft.PowerShell.PlatyPS.Model.CommandHelp
DefaultValue: ''
Globbing: false
SupportsWildcards: false
ParameterValue: []
Aliases: []
ParameterSets:
Expand All @@ -123,23 +98,17 @@ HelpMessage: ''

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, -WarningVariable.
For more information, see
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

### System.Management.Automation.HiThere
### Microsoft.PowerShell.PlatyPS.Model.CommandHelp

## OUTPUTS

### System.Object
### System.String

## NOTES

Just a note

## RELATED LINKS



Loading