PowerShell: Comment Syntax

By Xah Lee. Date: . Last updated: .

Line Comment

Line comment start with NUMBER SIGN # to end of line. Anything in between is ignored.

# this is a comment
# adds 2 numbers
3 + 4 # result is 7

Block Comment

<#
This is a block comment
Can be multiple lines.
#>

Cannot be nested

Block comment cannot be nested.