Comment blocks
The first recommendation is to create comment blocks for detailed tracking information about the PowerShell script itself. Comment blocks can track information about the script's creation, authors, changes, and other useful information that will enable you to quickly determine what the script is doing. PowerShell has built-in comment block support which integrates with the get-help
cmdlet.
The required components include the following:
- Comment block location: The comment block must be the first item defined at the top of your script. If you use parameter blocks, you specify the parameter blocks after the comment block.
- Start comment block: In order to integrate with the help system, you need to specify the starting of the comment block. To start a comment block, you type
<#
. .SYNOPSIS
: To create a synopsis for the script, type.SYNOPSIS
on a line, and then on a subsequent line type a one-line description of why the script is being created..DESCRIPTION
: To create a full...