21 lines
420 B
PowerShell
21 lines
420 B
PowerShell
function Get-ConfigurationDataItemValue {
|
|
[CmdletBinding()]
|
|
Param(
|
|
[AllowNull()]
|
|
$Item,
|
|
[Parameter(Mandatory=$true)]
|
|
[String]
|
|
$KeyName
|
|
)
|
|
|
|
if(-not (Test-ConfigurationDataItemContainsKey -Item $Item -KeyName $KeyName)){
|
|
return $null
|
|
}
|
|
|
|
if($Item -is [System.Collections.IDictionary]){
|
|
return $Item[$KeyName]
|
|
}
|
|
|
|
return $Item.$KeyName
|
|
}
|