Templates/PSJumpStartStdTemplate.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
<#
.Synopsis Template .DESCRIPTION This template will load $PSDefaultParameterValues and the PSJumpStart module and has support for Write-Verbose, -WhatIf and whatnot. .Notes Author date Changes #> [CmdletBinding(SupportsShouldProcess = $True)] param () #region local functions #endregion #region Init $scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Definition if (-not (Get-Module PSJumpStart)) { Import-Module PSJumpStart -Force } #Get global deafult settings when calling modules $PSDefaultParameterValues = Get-GlobalDefaultsFromDfpFiles $MyInvocation -Verbose:$VerbosePreference #endregion Msg "Start Execution" Write-Verbose "Script is in $scriptPath" if ($pscmdlet.ShouldProcess("ActiveCode", "Run Code")) { #Put your commands/code here... } Msg "End Execution" |