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

30 lines
614 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;
}
2021-09-09 08:14:17 -04:00
if ([string]::IsNullOrEmpty($JeaPid)) {
return $FALSE;
}
if ($JeaPid -eq '0' -Or $JeaPid -eq 0) {
return $FALSE;
}
2021-08-06 12:12:27 -04:00
$JeaPowerShellProcess = Get-Process -Id $JeaPid -ErrorAction SilentlyContinue;
if ($null -eq $JeaPowerShellProcess) {
return $FALSE;
}
if ($JeaPowerShellProcess.ProcessName -ne 'wsmprovhost') {
return $FALSE;
}
return $TRUE;
}