Add functions for configuration data handling and extend template merging capabilities
This commit is contained in:
22
Private/Get-ConfigurationDataDictionaryValue.ps1
Normal file
22
Private/Get-ConfigurationDataDictionaryValue.ps1
Normal file
@@ -0,0 +1,22 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user