@@ -70,7 +70,7 @@ function Install-Icinga()
7070 $JsonInstallCmd = ConvertFrom-Json - InputObject $InstallCommand - ErrorAction Stop;
7171 } catch {
7272 Write-IcingaConsoleError ' Failed to deserialize the provided JSON from file or command: {0}' - Objects $_.Exception.Message ;
73- $ Global :Icinga .Protected.ServiceRestartLock = $FALSE ;
73+ Clear-IcingaInternalServiceInformation ;
7474 return ;
7575 }
7676
@@ -84,7 +84,7 @@ function Install-Icinga()
8484 $Success = Invoke-IcingaForWindowsManagementConsoleCustomConfig - IcingaConfiguration $IcingaConfiguration ;
8585
8686 if ($Success -eq $FALSE ) {
87- $ Global :Icinga .Protected.ServiceRestartLock = $FALSE ;
87+ Clear-IcingaInternalServiceInformation ;
8888 return ;
8989 }
9090
@@ -105,7 +105,7 @@ function Install-Icinga()
105105 $Success = Invoke-IcingaForWindowsManagementConsoleCustomConfig - IcingaConfiguration $IcingaConfiguration ;
106106
107107 if ($Success -eq $FALSE ) {
108- $ Global :Icinga .Protected.ServiceRestartLock = $FALSE ;
108+ Clear-IcingaInternalServiceInformation ;
109109 return ;
110110 }
111111
@@ -116,7 +116,7 @@ function Install-Icinga()
116116 # Set our "old" swap live again. By doing so, we can still continue our old
117117 # configuration
118118 Set-IcingaPowerShellConfig - Path ' Framework.Config.Swap' - Value $OldConfigSwap ;
119- $ Global :Icinga .Protected.ServiceRestartLock = $FALSE ;
119+ Clear-IcingaInternalServiceInformation ;
120120 return ;
121121 }
122122
@@ -191,7 +191,7 @@ function Install-Icinga()
191191 }
192192 }
193193
194- $ Global :Icinga .Protected.ServiceRestartLock = $FALSE ;
194+ Clear-IcingaInternalServiceInformation ;
195195
196196 if ($null -ne (Get-Command - Name ' Set-IcingaForWindowsManagementConsoleClosing' - ErrorAction SilentlyContinue)) {
197197 Set-IcingaForWindowsManagementConsoleClosing - Completed;
0 commit comments