#requires -version 2.0 #v2Template.ps1 #This is demonstration script for the help feature in #PowerShell v2.0. This requires Windows 7 RC #you need at least one blank line before the help <# .Synopsis This does something really cool .Description Let me explain in a little more detail how cool this really is and why you want to use it. .Parameter Foo Describe the first parameter .Parameter Bar Describe the second parameter .Example PS C:\> this -foo goober This will do something amazing .Example PS C:\> something | this -bar testing | somethingelse In this example, objects are piped from something, piped to this which then pipes to somethingelse. .Inputs Accepts strings as pipelined input .Outputs [object] .Link Get-Something Get-Another Set-Something .Notes NAME: Do-Something VERSION: 1.0 AUTHOR: You LASTEDIT: today #> [CmdletBinding()] #define the parameters param ( [Parameter( ValueFromPipeline=$True, Position=0, Mandatory=$True, HelpMessage="Enter a foo name.")] [String[]]$Foo, [Parameter( ValueFromPipeline=$False, Position=1, Mandatory=$False, HelpMessage="Enter a bar value.")] [string]$bar="default" ) #main script or function body Write-Host "I'm going to do something really cool." -foregroundcolor Green