From the course: PowerShell 5 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Using comment-based help

Using comment-based help - PowerShell Tutorial

From the course: PowerShell 5 Essential Training

Start my 1-month free trial

Using comment-based help

- Now that I'm designing my script for someone else to use, it'd be awfully nice if I gave them some help. Now, you can always put comments into your scripts. There's a pound sign character. Notice how the colors turn green and you can put in "Main Code here." You can always put in comments. Also, let me just show you, you can also put in block comments, as well. Let me hit a few Enters here. Here's block comments, angle bracket and a hash, and then, there. And inside, you can now type whatever it is you wanna type. The parsing engine doesn't look at your comments, so it doesn't affect your code. Did I just say "the parsing engine doesn't look at your comments"? Yeah, I did. And here's something kind of interesting. If you do what PowerShell wants you to do, it'll make your life easier. Let me give you an example. Right now, I've got this. If I do get-help on DiskInfo, it's starting to build out the syntax already for me. That's because I'm doing things the way that PowerShell wants…

Contents