Partager via


PSObjectExtensions.HasProperty Method

Definition

Overloads

HasProperty(PSObject, String)

Determine if a given PSObject has a property with the given name

HasProperty<T>(PSObject, String)

Determine if a given PSObject has a property with the given name and type

HasProperty(PSObject, String)

Determine if a given PSObject has a property with the given name

public static bool HasProperty (this System.Management.Automation.PSObject source, string name);
static member HasProperty : System.Management.Automation.PSObject * string -> bool
<Extension()>
Public Function HasProperty (source As PSObject, name As String) As Boolean

Parameters

source
PSObject

The PSObject to check

name
String

The name of the property to look for

Returns

true if the PSObject has a property with the given name, otherwise false

Applies to

HasProperty<T>(PSObject, String)

Determine if a given PSObject has a property with the given name and type

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

Type Parameters

T

The type of the property to look for

Parameters

source
PSObject

The PSObject to check

name
String

The name of the property to look for

Returns

true if the PSObject has a property with the given name, otherwise false

Applies to