Using Comment-Based Help

PowerShell v.2 allows your functions to seamlessly integrate with the built-in PowerShell Help system. All you need to do is a Comment-Based- Help block into each function:

function Test-Me($parameter) {
<#
.SYNOPSIS
A useless function
.DESCRIPTION
This function really does nothing
.NOTES
Demonstrates comment based help
.LINK
http://www.powershell.com
.EXAMPLE
Test-Me "Hello World"
#>
}

Once you run this function, PowerShell will know where to look for Help, and you can use the built-in Get-Help to display the information in pretty much the same way as it already works for cmdlets:

Get-Help Test-Me
Get-Help Test-Me -examples

Twitter This Tip! ReTweet this Tip!


Posted Nov 06 2009, 08:00 AM by ps1

Comments

Twitter Trackbacks for Using Comment-Based Help - Power Tips - PowerShell.com [powershell.com] on Topsy.com wrote Twitter Trackbacks for Using Comment-Based Help - Power Tips - PowerShell.com [powershell.com] on Topsy.com
on 11-06-2009 11:06 AM

Pingback from  Twitter Trackbacks for                 Using Comment-Based Help - Power Tips - PowerShell.com         [powershell.com]        on Topsy.com

Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.