mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
20 lines
755 B
PowerShell
20 lines
755 B
PowerShell
function Get-IcingaAgentFeatures()
|
|
{
|
|
$Binary = Get-IcingaAgentBinary;
|
|
$ConfigResult = Start-IcingaProcess -Executable $Binary -Arguments 'feature list';
|
|
|
|
$DisabledFeatures = ($ConfigResult.Message.SubString(
|
|
0,
|
|
$ConfigResult.Message.IndexOf('Enabled features')
|
|
)).Replace('Disabled features: ', '').Replace("`r`n", '');
|
|
|
|
$EnabledFeatures = ($ConfigResult.Message.SubString(
|
|
$ConfigResult.Message.IndexOf('Enabled features'),
|
|
$ConfigResult.Message.Length - $ConfigResult.Message.IndexOf('Enabled features')
|
|
)).Replace('Enabled features: ', '').Replace("`r`n", '');
|
|
|
|
return @{
|
|
'Enabled' = ($EnabledFeatures.Split(' '));
|
|
'Disabled' = ($DisabledFeatures.Split(' '));
|
|
}
|
|
}
|