21 lines
409 B
PowerShell
21 lines
409 B
PowerShell
function Test-ConfigurationDataItemContainsKey {
|
|
[CmdletBinding()]
|
|
Param(
|
|
[AllowNull()]
|
|
$Item,
|
|
[Parameter(Mandatory=$true)]
|
|
[String]
|
|
$KeyName
|
|
)
|
|
|
|
if($null -eq $Item){
|
|
return $false
|
|
}
|
|
|
|
if($Item -is [System.Collections.IDictionary]){
|
|
return $Item.Contains($KeyName)
|
|
}
|
|
|
|
return $null -ne $Item.PSObject.Properties[$KeyName]
|
|
}
|