mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2026-02-03 12:19:29 -05:00
19 lines
438 B
PowerShell
19 lines
438 B
PowerShell
function Test-PSCustomObjectMember()
|
|
{
|
|
param (
|
|
$PSObject,
|
|
$Name
|
|
);
|
|
|
|
if ($null -eq $PSObject) {
|
|
return $FALSE;
|
|
}
|
|
|
|
# Lets make sure we also test for hashtables in case our object is a hashtable
|
|
# instead of a PSCustomObject
|
|
if ($PSObject -Is [hashtable]) {
|
|
return ([bool]($PSObject.ContainsKey($Name)));
|
|
}
|
|
|
|
return ([bool]($PSObject.PSObject.Properties.Name -eq $Name));
|
|
}
|