次の方法で共有


PSObjectExtensions.GetProperty Method

Definition

Overloads

GetProperty(PSObject, String)

Return the value of the given property from the given PSObject

GetProperty<T>(PSObject, String)

Return the value of the given property from the given PSObject

GetProperty(PSObject, String)

Return the value of the given property from the given PSObject

public static object GetProperty (this System.Management.Automation.PSObject source, string name);
static member GetProperty : System.Management.Automation.PSObject * string -> obj
<Extension()>
Public Function GetProperty (source As PSObject, name As String) As Object

Parameters

source
PSObject

The PSObject to retrieve the property from

name
String

The name of the property to retrieve

Returns

he property if found, otherwise null

Applies to

GetProperty<T>(PSObject, String)

Return the value of the given property from the given PSObject

public static T GetProperty<T> (this System.Management.Automation.PSObject source, string name);
static member GetProperty : System.Management.Automation.PSObject * string -> 'T
<Extension()>
Public Function GetProperty(Of T) (source As PSObject, name As String) As T

Type Parameters

T

The expected type of the property

Parameters

source
PSObject

The PSObject to retrieve the property from

name
String

The name of the property to retrieve

Returns

T

he property if found, otherwise the deefault value for T

Applies to