@@ -20,7 +20,7 @@ function Show-IcingaForWindowsMenuManageIcingaForWindowsServices()
20
20
' Caption' = ' Start Icinga Agent Service' ;
21
21
' Command' = ' Show-IcingaForWindowsMenuManageIcingaForWindowsServices' ;
22
22
' Help' = ' Allows you to start the Icinga Agent if the service is not running' ;
23
- ' Disabled' = ($null -eq $IcingaAgentService -Or $IcingaAgentStatus -eq ' Running' );
23
+ ' Disabled' = (-Not $IcingaAgentService.Present -Or $IcingaAgentStatus -eq ' Running' );
24
24
' DisabledReason' = ' The Icinga Agent service is either not installed or the service is already running' ;
25
25
' AdminMenu' = $TRUE ;
26
26
' Action' = @ {
@@ -32,7 +32,7 @@ function Show-IcingaForWindowsMenuManageIcingaForWindowsServices()
32
32
' Caption' = ' Stop Icinga Agent Service' ;
33
33
' Command' = ' Show-IcingaForWindowsMenuManageIcingaForWindowsServices' ;
34
34
' Help' = ' Allows you to stop the Icinga Agent if the service is not running' ;
35
- ' Disabled' = ($null -eq $IcingaAgentService -Or $IcingaAgentStatus -ne ' Running' );
35
+ ' Disabled' = (-Not $IcingaAgentService.Present -Or $IcingaAgentStatus -ne ' Running' );
36
36
' DisabledReason' = ' The Icinga Agent service is either not installed or the service is not running' ;
37
37
' AdminMenu' = $TRUE ;
38
38
' Action' = @ {
@@ -44,7 +44,7 @@ function Show-IcingaForWindowsMenuManageIcingaForWindowsServices()
44
44
' Caption' = ' Restart Icinga Agent Service' ;
45
45
' Command' = ' Show-IcingaForWindowsMenuManageIcingaForWindowsServices' ;
46
46
' Help' = ' Allows you to restart the Icinga Agent if the service is installed' ;
47
- ' Disabled' = ($null -eq $IcingaAgentService );
47
+ ' Disabled' = (-Not $IcingaAgentService.Present );
48
48
' DisabledReason' = ' The Icinga Agent service is not installed' ;
49
49
' AdminMenu' = $TRUE ;
50
50
' Action' = @ {
@@ -56,7 +56,7 @@ function Show-IcingaForWindowsMenuManageIcingaForWindowsServices()
56
56
' Caption' = ' Repair Icinga Agent Service' ;
57
57
' Command' = ' Show-IcingaForWindowsMenuManageIcingaForWindowsServices' ;
58
58
' Help' = ' Allows to repair the Icinga Agent service in case it was removed or broke during installation/upgrade' ;
59
- ' Disabled' = ($null -ne $ IcingaAgentService );
59
+ ' Disabled' = ($IcingaAgentService.Present );
60
60
' DisabledReason' = ' The Icinga Agent service is already present' ;
61
61
' AdminMenu' = $TRUE ;
62
62
' Action' = @ {
@@ -67,7 +67,7 @@ function Show-IcingaForWindowsMenuManageIcingaForWindowsServices()
67
67
' Caption' = ' Start Icinga for Windows Service' ;
68
68
' Command' = ' Show-IcingaForWindowsMenuManageIcingaForWindowsServices' ;
69
69
' Help' = ' Allows you to start the Icinga for Windows Service if the service is not running' ;
70
- ' Disabled' = ($null -eq $IcingaForWindowsService -Or $IcingaForWindowsStatus -eq ' Running' );
70
+ ' Disabled' = (-Not $IcingaForWindowsService.Present -Or $IcingaForWindowsStatus -eq ' Running' );
71
71
' DisabledReason' = ' The Icinga for Windows service is either not installed or already running' ;
72
72
' AdminMenu' = $TRUE ;
73
73
' Action' = @ {
@@ -79,7 +79,7 @@ function Show-IcingaForWindowsMenuManageIcingaForWindowsServices()
79
79
' Caption' = ' Stop Icinga for Windows Service' ;
80
80
' Command' = ' Show-IcingaForWindowsMenuManageIcingaForWindowsServices' ;
81
81
' Help' = ' Allows you to stop the Icinga for Windows Service if the service is not running' ;
82
- ' Disabled' = ($null -eq $IcingaForWindowsService -Or $IcingaForWindowsStatus -ne ' Running' );
82
+ ' Disabled' = (-Not $IcingaForWindowsService.Present -Or $IcingaForWindowsStatus -ne ' Running' );
83
83
' DisabledReason' = ' The Icinga for Windows service is either not installed or not running' ;
84
84
' AdminMenu' = $TRUE ;
85
85
' Action' = @ {
@@ -90,7 +90,7 @@ function Show-IcingaForWindowsMenuManageIcingaForWindowsServices()
90
90
' Caption' = ' Restart Icinga for Windows Service' ;
91
91
' Command' = ' Show-IcingaForWindowsMenuManageIcingaForWindowsServices' ;
92
92
' Help' = ' Allows you to restart the Icinga for Windows Service if the service is installed' ;
93
- ' Disabled' = ($null -eq $IcingaForWindowsService );
93
+ ' Disabled' = (-Not $IcingaForWindowsService.Present );
94
94
' DisabledReason' = ' The Icinga for Windows service is not installed' ;
95
95
' AdminMenu' = $TRUE ;
96
96
' Action' = @ {
@@ -101,7 +101,7 @@ function Show-IcingaForWindowsMenuManageIcingaForWindowsServices()
101
101
' Caption' = ' Enable recovery settings for services' ;
102
102
' Command' = ' Show-IcingaForWindowsMenuManageIcingaForWindowsServices' ;
103
103
' Help' = ' Enables automatic service recovery for the Icinga Agent and Icinga for Windows service, in case the server terminates itself because of errors' ;
104
- ' Disabled' = ($null -eq $IcingaForWindowsService -And $null -eq $IcingaAgentService );
104
+ ' Disabled' = (-Not $IcingaForWindowsService.Present -And -Not $IcingaAgentService.Present );
105
105
' DisabledReason' = ' Neither the Icinga Agent nor the Icinga for Windows service are installed' ;
106
106
' AdminMenu' = $TRUE ;
107
107
' Action' = @ {
@@ -112,7 +112,7 @@ function Show-IcingaForWindowsMenuManageIcingaForWindowsServices()
112
112
' Caption' = ' Disable recovery settings for services' ;
113
113
' Command' = ' Show-IcingaForWindowsMenuManageIcingaForWindowsServices' ;
114
114
' Help' = ' Disables automatic service recovery for the Icinga Agent and Icinga for Windows service, in case the server terminates itself because of errors' ;
115
- ' Disabled' = ($null -eq $IcingaForWindowsService -And $null -eq $IcingaAgentService );
115
+ ' Disabled' = (-Not $IcingaForWindowsService.Present -And -Not $IcingaAgentService.Present );
116
116
' DisabledReason' = ' Neither the Icinga Agent nor the Icinga for Windows service are installed' ;
117
117
' AdminMenu' = $TRUE ;
118
118
' Action' = @ {
0 commit comments