共用方式為


PSCodeProperty Constructors

Definition

Overloads

PSCodeProperty(String, MethodInfo)

Initializes a new instance of the PSCodeProperty class as a read only property.

PSCodeProperty(String, MethodInfo, MethodInfo)

Initializes a new instance of the PSCodeProperty class. Setter or getter can be null, but both cannot be null.

PSCodeProperty(String, MethodInfo)

Initializes a new instance of the PSCodeProperty class as a read only property.

public:
 PSCodeProperty(System::String ^ name, System::Reflection::MethodInfo ^ getterCodeReference);
public PSCodeProperty (string name, System.Reflection.MethodInfo getterCodeReference);
new System.Management.Automation.PSCodeProperty : string * System.Reflection.MethodInfo -> System.Management.Automation.PSCodeProperty
Public Sub New (name As String, getterCodeReference As MethodInfo)

Parameters

name
String

Name of the property.

getterCodeReference
MethodInfo

This should be a public static non void method taking one PSObject parameter.

Exceptions

If name is null or empty or getterCodeReference is null.

If getterCodeReference doesn't have the right format.

Applies to

PSCodeProperty(String, MethodInfo, MethodInfo)

Initializes a new instance of the PSCodeProperty class. Setter or getter can be null, but both cannot be null.

public:
 PSCodeProperty(System::String ^ name, System::Reflection::MethodInfo ^ getterCodeReference, System::Reflection::MethodInfo ^ setterCodeReference);
public PSCodeProperty (string name, System.Reflection.MethodInfo getterCodeReference, System.Reflection.MethodInfo setterCodeReference);
new System.Management.Automation.PSCodeProperty : string * System.Reflection.MethodInfo * System.Reflection.MethodInfo -> System.Management.Automation.PSCodeProperty
Public Sub New (name As String, getterCodeReference As MethodInfo, setterCodeReference As MethodInfo)

Parameters

name
String

Name of the property.

getterCodeReference
MethodInfo

This should be a public static non void method taking one PSObject parameter.

setterCodeReference
MethodInfo

This should be a public static void method taking 2 parameters, where the first is an PSObject.

Exceptions

When methodForGet and methodForSet are null.

if: - getterCodeReference doesn't have the right format, - setterCodeReference doesn't have the right format, - both getterCodeReference and setterCodeReference are null.

Applies to