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)

'Usage
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
)

Parameters

name

The name of the method.

codeReference

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
ArgumentException

The name or codeReference parameter is not valid.

ExtendedTypeSystemException

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.
Show:
© 2014 Microsoft