How do you call a generic static method of a custom class in Powershell?
Given the following class:
public class Sample
{
public static string MyMethod<T>( string anArgument )
{
return string.Format( "Generic type is {0} with argument {1}", typeof(T), anArgument );
}
}
And this is compiled into an assembly 'Classes.dll' and loaded into PowerShell like this:
Add-Type -Path "Classes.dll"
What's the easiest way to call the MyMethod method?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…