PowerShell Commenting


This entry is part 7 of 9 in the series PowerShell

You can and should write comments in tour PowerShell scrips. Use the hash (#) symbol at the beginning of the line to write a comment. You can also use a multi-line comment with <# to start and #> to end.

Region

As a special feaature of the scripting environment, we can use #region and then after some code #endregion. #region and #endregion are still just comments, but a special type of comment. They do nothing towards the actual execution of the script, but exist for the programmer and reader’s benfit. Why? They are collapsable in the editor.

Series Navigation<< PowerShell Batch FilesPowerShell Objects >>