Powershell Comments




Comments will not be executed by Powershell.
Comments can be added to explain the Powershell, or to make the code more readable.
Single line comments start with #.
The following example uses single line comments to explain the code:

Script example:

$greeting = "Hello" # This line is single line comment.
# This line is second line comment.
$name = read-host "What is your name?" # This comment line is new.
"$greeting, $name!"

Begin the comment with the <# tag, and end the comment with the #> tag:

<#

 this is a comment

            on several

            different

            lines

 #>

Copy and Try it