#requires -version 2.0 Function New-Function { $name=Read-Host "What do you want to call the new function?" $functionText=@" #requires -version 2.0 # ----------------------------------------------------------------------------- # Script: $name.ps1 # Author: $env:userdomain\$env:username # Date: $((get-date).ToShortDateString()) # Keywords: # Comments: # # ----------------------------------------------------------------------------- Function $name { <# .Synopsis This does that .Description A longer explanation .Parameter The parameter .Example PS C:\> Example- accomplishes .Notes NAME: $($name) VERSION: 1.0 AUTHOR: $env:userdomain\$env:username LASTEDIT: $(Get-Date) .Link about_Windows_PowerShell_2.0 .Inputs [String] .Outputs #> [cmdletBinding()] Param( [Parameter(Position=0,Mandatory=`$False, ValueFromPipeline=`$True)] [string[]]`$var ) Begin { Write-Verbose -Message "Starting `$(`$myinvocation.mycommand)" } #close Begin Process { Foreach (`$item in `$var) { }#close Foreach $item } #close process End { Write-Verbose -Message "Ending `$(`$myinvocation.mycommand)" } #close End } #end Function "@ #load the function text into the current file in the ISE $psise.CurrentFile.Editor.InsertText($FunctionText) } #end function