你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

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