-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allowing Markdown Help sections to be hidden (Fixes #124)
- Loading branch information
James Brundage
committed
May 26, 2023
1 parent
7308f5f
commit 3fd86aa
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<# | ||
.SYNOPSIS | ||
Hides sections of markdown help | ||
.DESCRIPTION | ||
Hides sections of a command's markdown help. | ||
#> | ||
param( | ||
# One or more section names. | ||
[ValidateSet('Name','Synopsis','Description','RelatedLinks','Examples','Parameters','Inputs','Outputs','Notes','Story','Syntax')] | ||
[Alias('SectionName')] | ||
[string[]] | ||
$SectionNames | ||
) | ||
|
||
|
||
$skipSectionNames = @($This.HideSections) | ||
foreach ($SectionName in $SectionNames) { | ||
if ($skipSectionNames -notcontains $SectionName) { | ||
$skipSectionNames += $SectionName | ||
} | ||
} | ||
|
||
$this | | ||
Add-Member NoteProperty HideSections $skipSectionNames -Force |