Files
Merge-DSCConfigurationData/Private/Get-ConfigurationDataItemValue.ps1
Torsten Brendgen e10ab48bb4 Creating Module
2026-04-21 13:02:51 +02:00

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
}