icinga-powershell-framework/lib/core/jea/Test-IcingaJEAServiceRunning.psm1

22 lines
465 B
PowerShell
Raw Normal View History

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