PowerShell Advanced function template