The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

lurkusmaximus (2) [Avatar] Offline
#1
Nowhere in your book have I found documentation for adding comments to powershell scripts. To make my scripts more maintainable, I really want to add some comment text. How does one go about this?
hstagni (2) [Avatar] Offline
#2
Re: Comments in powershell scripts?
I guess you can make comments by starting a line with an "#" caracter
The whole line will be commented

EX:

#This is a script
$a = 5+5 # variable a has 10
#end of script
lurkusmaximus (2) [Avatar] Offline
#3
Re: Comments in powershell scripts?
Thanks! That's what I was looking for.