1

According to TechNet one of the keywords for the comment-based help is .Notes. But when I include this keyword the corresponding help text is not displayed.

My script:

<#
.DESCRIPTION
This describes the script.

.NOTES
This is a note about the script.
#>

"Hello world"

Output of Get-Help:

PS E:\> Get-Help .\Test-Script.ps1

NAME
    E:\Test-Script.ps1

SYNOPSIS


SYNTAX
    E:\Test-Script.ps1 [<CommonParameters>]


DESCRIPTION
    This describes the script.


RELATED LINKS

REMARKS
    To see the examples, type: "get-help E:\Test-Script.ps1 -examples".
    For more information, type: "get-help E:\Test-Script.ps1 -detailed".
    For technical information, type: "get-help E:\Test-Script.ps1 -full".

I know the .Notes keyword is being recognized because if I misspell it, say as ".NotesX", running Get-Help doesn't return any custom help:

PS E:> Get-Help .\Test-Script.ps1
Test-Script.ps1

I looked for a custom switch that Get-Help might require before displaying this section, like the -example shows the content from the .Example keyword(s), but didn't find one. I'm trying this on PowerShell v5.1.

How can I get the .Notes section to display when Get-Help is run?

1 Answer 1

4

See Get-Help Get-Help

REMARKS

To see the examples, type: "get-help Get-Help -examples".
For more information, type: "get-help Get-Help -detailed".
For technical information, type: "get-help Get-Help -full".
For online help, type: "get-help Get-Help -online"

So you can use:

Get-Help .\Test-Script.ps1 -full
1
  • 1
    This stuff is why I hate Powershell. I would expect -detailed to include notes.
    – Pxtl
    Commented Aug 17, 2023 at 15:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.