Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -680,10 +680,7 @@ private static IEnumerable<FormatViewDefinition> ViewsOf_MamlCommandHelpInfo_Ful
.StartFrame(leftIndent: 4)
.AddPropertyExpressionBinding(@"title")
.AddNewline()
.AddNewline()
.StartFrame(leftIndent: 4)
.AddPropertyExpressionBinding(@"alert", enumerateCollection: true, customControl: sharedControls[11])
.EndFrame()
.AddPropertyExpressionBinding(@"alert", enumerateCollection: true, customControl: sharedControls[11])
.AddNewline()
.EndFrame()
.EndEntry()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

Describe 'Comment-based help NOTES section formatting' -Tags "CI", "Feature" {
It 'NOTES section should have single blank line after header and 4-space indentation' {
$helpText = Get-Help Remove-PSSession -Full | Out-String
$lines = $helpText -split "`r?`n"

# Find NOTES section
$notesIndex = -1
for ($i = 0; $i -lt $lines.Count; $i++) {
if ($lines[$i] -match '^NOTES\s*$') {
$notesIndex = $i
break
}
}

$notesIndex | Should -BeGreaterThan -1 -Because "NOTES section should exist"

# The line after NOTES header should be blank
$lines[$notesIndex + 1] | Should -Match '^\s*$' -Because "There should be a blank line after NOTES header"

# The second line after NOTES header should have content with 4-space indentation
$contentLine = $lines[$notesIndex + 2]
$contentLine | Should -Match '^[ ]{4}\S' -Because "Content should have exactly 4-space indentation"
}
}
Loading