icinga-powershell-framework/lib/core/jea/Test-IcingaJEAServiceRunning.psm1
2021-09-09 15:23:09 +02:00

25 lines
539 B
PowerShell

function Test-IcingaJEAServiceRunning()
{
param (
[string]$JeaPid = $null
);
if ([string]::IsNullOrEmpty($JeaPid)) {
[string]$JeaPid = Get-IcingaJEAServicePid;
}
if ([string]::IsNullOrEmpty($JeaPid)) {
return $FALSE;
}
$JeaPowerShellProcess = Get-Process -Id $JeaPid -ErrorAction SilentlyContinue;
if ($null -eq $JeaPowerShellProcess) {
return $FALSE;
}
if ($JeaPowerShellProcess.ProcessName -ne 'wsmprovhost') {
return $FALSE;
}
return $TRUE;
}