mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 15:19:58 -05:00
21 lines
450 B
PowerShell
21 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;
|
||
|
|
}
|