How do you call a generic static method of a custom class in Powershell?
Given the following class:
public class Sample
{
public static string My
This is a limitation of PowerShell and can't be done directly in PowerShell V1 or V2 AFAIK.
BTW your generic method isn't really generic. Shouldn't it be:
public static string MyMethod(T anArgument)
{
return string.Format( "Generic type is {0} with argument {1}",
typeof(T), anArgument.ToString());
}
If you own this code and want to use it from PowerShell, avoid generic methods or write a non-generic C# wrapper method.