Creating Module
This commit is contained in:
20
Private/Test-ConfigurationDataItemContainsKey.ps1
Normal file
20
Private/Test-ConfigurationDataItemContainsKey.ps1
Normal file
@@ -0,0 +1,20 @@
|
||||
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]
|
||||
}
|
||||
Reference in New Issue
Block a user