PSCodeMethod Constructor

Creates a new PSCodeMethod object that contains the name for the method and the underlying CLR method that this new method is based on.

Namespace: System.Management.Automation
Assembly: System.Management.Automation (in System.Management.Automation.dll)

Dim name As String
Dim codeReference As MethodInfo

Dim instance As New PSCodeMethod(name, codeReference)

public PSCodeMethod (
	string name,
	MethodInfo codeReference
public PSCodeMethod (
	String name, 
	MethodInfo codeReference
public function PSCodeMethod (
	name : String, 
	codeReference : MethodInfo



The name of the method.


A MethodInfo object that contains the underlying method that the new method is based on. The referenced method must be a public static method where the first parameter is a PSObject object.

Exception typeCondition

The name or codeReference parameter is not valid.


The codeReference parameter does not have the correct format.

A code method is an extended member that is defined in a CLR language. For more information about code methods as well as other method types used by ETS, see ETS Methods. For more information about ETS, see Windows PowerShell Extended Type System (ETS).


Target Platforms

Windows Developer Preview, Windows Server Developer Preview

Send comments about this topic to Microsoft.
© 2014 Microsoft