How do you comment out code in PowerShell (1.0 or 2.0)?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In PowerShell V1 there’s only
#to make the text after it a comment.In PowerShell V2
<# #>can be used for block comments and more specifically for help comments.For more explanation about
.SYNOPSISand.*see about_Comment_Based_Help.Remark: These function comments are used by the
Get-HelpCmdLet and can be put before the keywordFunction, or inside the{}before or after the code itself.