in

WindowsWindows Loving ItLoving It

# is used for comments in PowerShell

The pound symbol is used for a single line comment in Powrshell. The text enclosed between is multi line comments in PowerShell.

Pound PowerShell Comment
  • In PowerShell, the pound (#) symbol is used to create a comment.  Everything to the right of the # symbol is ignored by PowerShell.
  • Here is an example for a comment

# This is a comment!

Single line comment
Single line comment

[LATEST] PowerShell Extension in Visual Studio Code

  • We can make a multiline comment using the following syntax.

<#  #>

  • Note that everything enclosed between the above tags is ignored as comments by PowerShell.
  • The below image shows the output.
multi line comment
multi-line comment

 

Leave a Reply

Your email address will not be published. Required fields are marked *