Data/MetaFunction/functionTemplate.ps1
<% "function $PLASTER_PARAM_FunctionName" %> { <# .Synopsis Short description .DESCRIPTION Long description .EXAMPLE Example of how to use this cmdlet #> [CmdletBinding(SupportsShouldProcess=$true)] param ( [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] [ValidateSet("DEV", "STG", "PRD")] [string]$Environment, [Parameter( Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] [ValidateScript({Test-Path $_ -PathType Any})] [string]$Path ) BEGIN{ <% " Write-Debug 'Starting $PLASTER_PARAM_FunctionName...'" %> }#begin PROCESS{ if ($psCmdlet.ShouldProcess("## object ##", "## message ##")) { ## action goes here ### allows you to use the -whatif param on this function } }#process END{ <% " Write-Debug 'Finished $PLASTER_PARAM_FunctionName...'" %> }#end } |