Skip to content

Commit 6ce759c

Browse files
committed
WIP
1 parent 5cd09c3 commit 6ce759c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/core/installer/menu/manage/settings/services/ManageServices.psm1

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function Show-IcingaForWindowsMenuManageIcingaForWindowsServices()
2020
'Caption' = 'Start Icinga Agent Service';
2121
'Command' = 'Show-IcingaForWindowsMenuManageIcingaForWindowsServices';
2222
'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');
2424
'DisabledReason' = 'The Icinga Agent service is either not installed or the service is already running';
2525
'AdminMenu' = $TRUE;
2626
'Action' = @{
@@ -32,7 +32,7 @@ function Show-IcingaForWindowsMenuManageIcingaForWindowsServices()
3232
'Caption' = 'Stop Icinga Agent Service';
3333
'Command' = 'Show-IcingaForWindowsMenuManageIcingaForWindowsServices';
3434
'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');
3636
'DisabledReason' = 'The Icinga Agent service is either not installed or the service is not running';
3737
'AdminMenu' = $TRUE;
3838
'Action' = @{
@@ -44,7 +44,7 @@ function Show-IcingaForWindowsMenuManageIcingaForWindowsServices()
4444
'Caption' = 'Restart Icinga Agent Service';
4545
'Command' = 'Show-IcingaForWindowsMenuManageIcingaForWindowsServices';
4646
'Help' = 'Allows you to restart the Icinga Agent if the service is installed';
47-
'Disabled' = ($null -eq $IcingaAgentService);
47+
'Disabled' = (-Not $IcingaAgentService.Present);
4848
'DisabledReason' = 'The Icinga Agent service is not installed';
4949
'AdminMenu' = $TRUE;
5050
'Action' = @{
@@ -56,7 +56,7 @@ function Show-IcingaForWindowsMenuManageIcingaForWindowsServices()
5656
'Caption' = 'Repair Icinga Agent Service';
5757
'Command' = 'Show-IcingaForWindowsMenuManageIcingaForWindowsServices';
5858
'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);
6060
'DisabledReason' = 'The Icinga Agent service is already present';
6161
'AdminMenu' = $TRUE;
6262
'Action' = @{
@@ -67,7 +67,7 @@ function Show-IcingaForWindowsMenuManageIcingaForWindowsServices()
6767
'Caption' = 'Start Icinga for Windows Service';
6868
'Command' = 'Show-IcingaForWindowsMenuManageIcingaForWindowsServices';
6969
'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');
7171
'DisabledReason' = 'The Icinga for Windows service is either not installed or already running';
7272
'AdminMenu' = $TRUE;
7373
'Action' = @{
@@ -79,7 +79,7 @@ function Show-IcingaForWindowsMenuManageIcingaForWindowsServices()
7979
'Caption' = 'Stop Icinga for Windows Service';
8080
'Command' = 'Show-IcingaForWindowsMenuManageIcingaForWindowsServices';
8181
'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');
8383
'DisabledReason' = 'The Icinga for Windows service is either not installed or not running';
8484
'AdminMenu' = $TRUE;
8585
'Action' = @{
@@ -90,7 +90,7 @@ function Show-IcingaForWindowsMenuManageIcingaForWindowsServices()
9090
'Caption' = 'Restart Icinga for Windows Service';
9191
'Command' = 'Show-IcingaForWindowsMenuManageIcingaForWindowsServices';
9292
'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);
9494
'DisabledReason' = 'The Icinga for Windows service is not installed';
9595
'AdminMenu' = $TRUE;
9696
'Action' = @{
@@ -101,7 +101,7 @@ function Show-IcingaForWindowsMenuManageIcingaForWindowsServices()
101101
'Caption' = 'Enable recovery settings for services';
102102
'Command' = 'Show-IcingaForWindowsMenuManageIcingaForWindowsServices';
103103
'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);
105105
'DisabledReason' = 'Neither the Icinga Agent nor the Icinga for Windows service are installed';
106106
'AdminMenu' = $TRUE;
107107
'Action' = @{
@@ -112,7 +112,7 @@ function Show-IcingaForWindowsMenuManageIcingaForWindowsServices()
112112
'Caption' = 'Disable recovery settings for services';
113113
'Command' = 'Show-IcingaForWindowsMenuManageIcingaForWindowsServices';
114114
'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);
116116
'DisabledReason' = 'Neither the Icinga Agent nor the Icinga for Windows service are installed';
117117
'AdminMenu' = $TRUE;
118118
'Action' = @{

0 commit comments

Comments
 (0)