14 Simple help: Making a comment

 

One of the things we all love about PowerShell is its help system. Like Linux’s man pages, PowerShell’s help files can provide information, examples, instructions, and more. So, we want to provide help with the tools we create—and you should too. You have two ways of doing so.

First is the easiest solution, which is comment-based help. You simply put the help files at the top of your scripts and functions, and PowerShell will interpret these as the help files. Second, an external help file is generally written in Markdown format. You can use modules such as PlatyPS to help create these files. For now, we’ll use the simpler, single-language, comment-based help inside your function.

14.1 Where to put your help

There are three defined places where PowerShell will look for your specially formatted comments to turn them into help displays:

14.2 Getting started

14.3 Going further with comment-based help

14.4 Broken help

14.5 Beyond comments

14.6 Your turn

14.6.1 Start here

14.6.2 Your task

14.6.3 Our take

Summary