<#.SYNOPSIS
Short one-liner - Script does this
.DESCRIPTION
Full and detailed description of all function actions
.PARAMETER computername
This is a description of the parameters that can be used in your function. You can add as many Parameters as you need.
Leave this blank if it does not apply.
.NOTES
Name: Name of Function
Author: Your Name
DateCreated: Date Created or Last Modified
.EXAMPLE
Show how to invoke the function with the desired syntax
.EXAMPLE
Give examples using any and all parameters and pipe inputs (if any) that the function will accept
#>
function MyExample-Function {
#Cmdletbinding allows you to use PowerShell Common Parameters with your function without coding them
#This will give you the ability to use Verbose and ErrorAction switches to control Function actions and output.
[cmdletbinding(
DefaultParameterSetName = '',
ConfirmImpact = 'low'
)]
param(
[Parameter(
Mandatory = $True,
Position = 0,
ParameterSetName = '',
ValueFromPipeline = $True)]
[string[]]$computername
)
Write-Host "This is my Example Function to show you how to construct comment based help"
}
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (1)
Commented:
If you want to know more about Comment Based Help, use get-help about_Comment_Based_Help or the online help at http://technet.microsoft.com/en-us/library/hh847834.aspx) .
There are certain restrictions where the comment can be placed, and other restrictions which apply like no more than one empty line after/before it if outside of a function.
Lastly, Get-Help works without CBH, and hence a CBH should add important info to what would be auto-generated, else it just isn't worth the effort.