PowerShell Comments and Documentation

Leaving comments in a script will help you — and your colleagues — better understand what the script does.

Types of Comments

String Comments

A string comment is a single line that starts with a number sign (#):

# that is a string comment

Block Comments

Block comments spread across multiple lines, starting and ending with number signs and angle brackets:

<#
and that is
    a block
        comment
#>

Example