You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Get-Help ignores non-standard comment-based help keywords, so custom boilerplate sections are silently dropped from -Full output. #28289
Get-Help silently drops non-standard keywords from comment-based help blocks. Teams that standardize their script headers with custom sections (for example .RISK CLASSIFICATION, .ENVIRONMENT ASSUMPTIONS, .REQUIREMENTS, .VERSION) cannot display them through Get-Help without opening the file.
Currently, when you run get-help on a script it only parses the boilerplate values it is aware of like .NOTES, .PARAMETER, .DESCRIPTION, and so on. I am hoping we can get an extra flag added to get-help to get other fields and display that in a formatted manner to screen.
NOTE - This is a display feature, not a validation feature. Teams should enforce their own boilerplate standards with tooling, as ours does.
Add an -IncludeUnknown switch to Get-Help. When specified, Get-Help parses the first comment-based help block in the script (<# to #>), and only the first comment-based help block in the script, and renders every keyword it doesn’t recognize.
-IncludeUnknown alone shows only the unknown sections.
-IncludeUnknown combined with -Full shows the standard output followed by the unknown sections.
Without -IncludeUnknown, behavior is unchanged, so this is non-breaking.
Unknown sections render in file order after the standard sections, with the heading kept exactly as written (for example .RISK CLASSIFICATION), content indented beneath it, and internal blank lines preserved.
If first comment block contains no section headers, then nothing is added by adding include unknown.
Sample code:
<#
.REQUIREMENTS
- Powershell 7
#>
Current behavior - .REQUIREMENTSare not shown.
New behavior - if -IncludeUknown is present, .REQUIREMENTS are shown when get-help is called.
NOTE - This is a display feature, not a validation feature. Teams should enforce their own boilerplate standards with tooling, as ours does.
Activity