icinga-powershell-framework/lib/core/windows/Restart-IcingaWindowsService.psm1

17 lines
497 B
PowerShell
Raw Normal View History

function Restart-IcingaForWindows()
2021-08-06 12:12:27 -04:00
{
[string]$JeaPid = Get-IcingaJEAServicePid;
Stop-IcingaService -Service 'icingapowershell';
if ((Test-IcingaJEAServiceRunning -JeaPid $JeaPid)) {
Stop-IcingaJEAProcess -JeaPid $JeaPid;
2021-08-06 12:12:27 -04:00
}
Restart-IcingaService -Service 'icingapowershell';
# Update the process priority after each restart
Start-IcingaWindowsScheduledTaskProcessPriority;
2021-08-06 12:12:27 -04:00
}
Set-Alias -Name 'Restart-IcingaWindowsService' -Value 'Restart-IcingaForWindows';