icinga-powershell-framework/lib/core/icingaagent/misc/Show-IcingaAgentObjects.psm1
2019-09-29 18:25:40 +02:00

12 lines
372 B
PowerShell

function Show-IcingaAgentObjects()
{
$Binary = Get-IcingaAgentBinary;
$Output = Start-IcingaProcess -Executable $Binary -Arguments 'object list';
if ($Output.ExitCode -ne 0) {
Write-Host ([string]::Format('Failed to fetch Icinga Agent objects list: {0}{1}', $Output.Message, $Output.Error));
return $null;
}
return $Output.Message;
}