icinga-powershell-framework/lib/config/Get-IcingaPowerShellConfig.psm1
2019-10-05 21:56:23 +02:00

20 lines
450 B
PowerShell

function Get-IcingaPowerShellConfig()
{
param(
$Path = ''
);
$Config = Read-IcingaPowerShellConfig;
$PathArray = $Path.Split('.');
$ConfigObject = $Config;
foreach ($entry in $PathArray) {
if (-Not (Test-IcingaPowerShellConfigItem -ConfigObject $ConfigObject -ConfigKey $entry)) {
return $null;
}
$ConfigObject = $ConfigObject.$entry;
}
return $ConfigObject;
}