File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ function Get-IcingaServices()
2424
2525 [array ]$DependentServices = $null ;
2626 [array ]$DependingServices = $null ;
27+ $ServiceExitCode = 0 ;
2728 [string ]$ServiceUser = ' ' ;
2829
2930 if ($Exclude -contains $service.ServiceName ) {
@@ -32,7 +33,8 @@ function Get-IcingaServices()
3233
3334 foreach ($wmiService in $ServiceWmiInfo ) {
3435 if ($wmiService.Name -eq $service.ServiceName ) {
35- $ServiceUser = $wmiService.StartName ;
36+ $ServiceUser = $wmiService.StartName ;
37+ $ServiceExitCode = $wmiService.ExitCode ;
3638 break ;
3739 }
3840 }
@@ -82,7 +84,7 @@ function Get-IcingaServices()
8284 ' value' = $service.StartType ;
8385 };
8486 ' ServiceUser' = $ServiceUser ;
85- ' ExitCode' = [ int ] $service .ExitCode ;
87+ ' ExitCode' = $ServiceExitCode ;
8688 }
8789 }
8890 );
You can’t perform that action at this time.
0 commit comments