File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 11function Get-IcingaServices ()
22{
33 param (
4- [array ]$Service
4+ [array ]$Service ,
5+ [array ]$Exclude = @ ()
56 );
67
78 $ServiceInformation = Get-Service - Name $Service - ErrorAction SilentlyContinue;
@@ -25,6 +26,10 @@ function Get-IcingaServices()
2526 [array ]$DependingServices = $null ;
2627 [string ]$ServiceUser = ' ' ;
2728
29+ if ($Exclude -contains $service.ServiceName ) {
30+ continue ;
31+ }
32+
2833 foreach ($wmiService in $ServiceWmiInfo ) {
2934 if ($wmiService.Name -eq $service.ServiceName ) {
3035 $ServiceUser = $wmiService.StartName ;
@@ -77,6 +82,7 @@ function Get-IcingaServices()
7782 ' value' = $service.StartType ;
7883 };
7984 ' ServiceUser' = $ServiceUser ;
85+ ' ExitCode' = [int ]$service.ExitCode ;
8086 }
8187 }
8288 );
You can’t perform that action at this time.
0 commit comments