PowerShell: Comment Syntax

By Xah Lee. Date: .

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

Block comment start with <# and ends wiht #>. Anything in between is ignored.

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

PowerShell

Practical How-To

list files

list dirs

on dir

on file

Windows config

misc


PowerShell in Depth

Programing PowerShell

Value Types

String

Variable

Boolean

Conditional

Data Structure

Loop and Iteration

Input/Output

Function

Profile and Script

Script Examples