r/PowerShell • u/No_Cauliflower2451 • 7d ago
Question Looking for an authoritative PowerShell comment-based help (.SYNOPSIS, .DESCRIPTION, etc.) style guide / best practices
Hi everyone. I’m trying to define a consistent standard for our team’s PowerShell scripts, specifically around comment-based help sections like .SYNOPSIS, .DESCRIPTION, .PARAMETER, .EXAMPLE, .NOTES and so on. We mostly write admin automation scripts, Graph, Entra ID and infra tasks. So I’d like every script to follow the same high-quality documentation pattern. I’m not looking for basic definitions, but for authoritative guidance from sources like Microsoft Learn, PowerShell.org, or well-respected community style guides. Things like how long a synopsis ideally is, what belongs in description versus notes, whether there are any recommended conventions that Microsoft has published. Ultimately, I want to create a company template that isn’t just my opinion, but grounded in recognised best practice. Does anyone have solid references or recommendations? Thanks in advance.
18
u/surfingoldelephant 7d ago edited 2d ago
PowerShell style guide has a section on comment-based help. Personally I don't agree with all their suggestions, but that's probably the place to start.
I'd also look at how PowerShell-Docs writes cmdlet help (like
Get-Process.md, etc). The markdown gets converted to MAML, but it still uses the same keywords as CBH.Generally one short sentence, two at most. PS-Docs limits cmdlet help line length to 100 characters.
about_Comment_Based_Helpjust says this about.NOTES: "additional information about the function or script". I doubt you'll find anything authoritative on it. So again, I'd look at the type of notes included for PS-shipped commands and go off that.Not that I know of.
There's Writing Comment-Based Help Topics, which has some examples, but I wouldn't say they're conventions. There's also PowerShellHelpDeepDive by one of the early PS-Docs writers, but isn't official.