-
Notifications
You must be signed in to change notification settings - Fork 4
Test PropertyExists
wim-beck edited this page Feb 28, 2017
·
1 revision
Test if a given property exists on a PSObject.
Test-PropertyExists [-Object] <PSObject> [-Property] <String> [<CommonParameters>]
Test if a given property exists on a PSObject. This is an equivalent of the check if($object.property) { ... } But this check trhows errors when using strict mode, hence this method. [Source: https://powershell.org/forums/topic/testing-for-property-existance]
Property | Value |
---|---|
Type | PSObject |
Required | true |
Position | 1 |
Default value | |
Accept pipeline input | false |
Property | Value |
---|---|
Type | String |
Required | true |
Position | 2 |
Default value | |
Accept pipeline input | false |