Invoke-GenericMethod PowerShell function