icinga-powershell-framework/lib/daemon/Get-IcingaBackgroundDaemons.psm1
Lord Hepipud 4ef55bddb4 Fixes lots of code styling, spelling and script analyzer
Disabling UseConsistentIndentation because it is not
properly working for multi-line commands with arguments
and array/hashtable objects
2022-01-14 22:26:53 +01:00

22 lines
525 B
PowerShell

function Get-IcingaBackgroundDaemons()
{
$Daemons = Get-IcingaPowerShellConfig -Path 'BackgroundDaemon.EnabledDaemons';
if ($null -eq $Daemons) {
return $null;
}
[hashtable]$Output = @{ };
foreach ($daemon in $Daemons.PSObject.Properties) {
$Arguments = @{ };
foreach ($argument in $daemon.Value.Arguments.PSObject.Properties) {
$Arguments.Add($argument.Name, $argument.Value);
}
$Output.Add($daemon.Name, $Arguments);
}
return $Output;
}