icinga-powershell-framework/lib/core/icingaagent/getters/Get-IcingaAgentBinary.psm1

16 lines
429 B
PowerShell
Raw Normal View History

2019-09-29 12:25:40 -04:00
function Get-IcingaAgentBinary()
{
$IcingaRootDir = Get-IcingaAgentRootDirectory;
if ([string]::IsNullOrEmpty($IcingaRootDir)) {
throw 'The Icinga Agent seems not to be installed';
}
2019-09-29 12:25:40 -04:00
$IcingaBinary = (Join-Path -Path $IcingaRootDir -ChildPath '\sbin\icinga2.exe');
if ((Test-Path $IcingaBinary) -eq $FALSE) {
throw 'Icinga Agent binary could not be found';
}
return $IcingaBinary;
}