PowerShell Template Function