mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-24 00:29:38 -05:00
Fixes service exit code fetching
This commit is contained in:
parent
9e52d16a3d
commit
96314bfe8c
1 changed files with 4 additions and 2 deletions
|
|
@ -24,6 +24,7 @@ function Get-IcingaServices()
|
|||
|
||||
[array]$DependentServices = $null;
|
||||
[array]$DependingServices = $null;
|
||||
$ServiceExitCode = 0;
|
||||
[string]$ServiceUser = '';
|
||||
|
||||
if ($Exclude -contains $service.ServiceName) {
|
||||
|
|
@ -32,7 +33,8 @@ function Get-IcingaServices()
|
|||
|
||||
foreach ($wmiService in $ServiceWmiInfo) {
|
||||
if ($wmiService.Name -eq $service.ServiceName) {
|
||||
$ServiceUser = $wmiService.StartName;
|
||||
$ServiceUser = $wmiService.StartName;
|
||||
$ServiceExitCode = $wmiService.ExitCode;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -82,7 +84,7 @@ function Get-IcingaServices()
|
|||
'value' = $service.StartType;
|
||||
};
|
||||
'ServiceUser' = $ServiceUser;
|
||||
'ExitCode' = [int]$service.ExitCode;
|
||||
'ExitCode' = $ServiceExitCode;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue