23 lines
493 B
PowerShell
23 lines
493 B
PowerShell
function Get-ConfigurationDataDictionaryValue {
|
|
[CmdletBinding()]
|
|
Param(
|
|
[Parameter(Mandatory=$true)]
|
|
[System.Collections.IDictionary]
|
|
$Dictionary,
|
|
|
|
[Parameter(Mandatory=$true)]
|
|
[string]
|
|
$Key,
|
|
|
|
[Parameter(Mandatory=$false)]
|
|
[AllowNull()]
|
|
$DefaultValue = $null
|
|
)
|
|
|
|
if(Test-ConfigurationDataDictionaryKey -Dictionary $Dictionary -Key $Key){
|
|
return $Dictionary[$Key]
|
|
}
|
|
|
|
return $DefaultValue
|
|
}
|