Home/PowerShell/PowerShell Comments

PowerShell Comments

Same like other programming language, the comments in Powershell will not executed. Comments can be added to explain the function of the code and it can  be placed anywhere and anything between them will be treated as a comment. The powershell also supports single line and multi line comments.

Single Line Comments


The comment with the # will handling single line comments. In PowerShell single line comments start with a hash symbol and everything to the right of the # will be ignored.

Multi-line Comments

Begin the comment with the <# tag, and end the comment with the #> tag for handling multiline. Multi-line comments are typically used to add descriptive help at the start of a script.

SYNTAX: <# #>


READ  How to validate the version of installation

Leave A Comment