@@ -13,6 +13,8 @@ function Install-Icinga()
1313 # Always ensure we use the proper TLS Version
1414 Set-IcingaTLSVersion ;
1515
16+ $Global :Icinga.Protected.ServiceRestartLock = $TRUE ;
17+
1618 # Ignore SSL validation in case we set the flag
1719 if ($NoSSLValidation ) {
1820 Enable-IcingaUntrustedCertificateValidation ;
@@ -68,6 +70,7 @@ function Install-Icinga()
6870 $JsonInstallCmd = ConvertFrom-Json - InputObject $InstallCommand - ErrorAction Stop;
6971 } catch {
7072 Write-IcingaConsoleError ' Failed to deserialize the provided JSON from file or command: {0}' - Objects $_.Exception.Message ;
73+ $Global :Icinga.Protected.ServiceRestartLock = $FALSE ;
7174 return ;
7275 }
7376
@@ -81,6 +84,7 @@ function Install-Icinga()
8184 $Success = Invoke-IcingaForWindowsManagementConsoleCustomConfig - IcingaConfiguration $IcingaConfiguration ;
8285
8386 if ($Success -eq $FALSE ) {
87+ $Global :Icinga.Protected.ServiceRestartLock = $FALSE ;
8488 return ;
8589 }
8690
@@ -101,6 +105,7 @@ function Install-Icinga()
101105 $Success = Invoke-IcingaForWindowsManagementConsoleCustomConfig - IcingaConfiguration $IcingaConfiguration ;
102106
103107 if ($Success -eq $FALSE ) {
108+ $Global :Icinga.Protected.ServiceRestartLock = $FALSE ;
104109 return ;
105110 }
106111
@@ -111,7 +116,7 @@ function Install-Icinga()
111116 # Set our "old" swap live again. By doing so, we can still continue our old
112117 # configuration
113118 Set-IcingaPowerShellConfig - Path ' Framework.Config.Swap' - Value $OldConfigSwap ;
114-
119+ $ Global :Icinga .Protected.ServiceRestartLock = $FALSE ;
115120 return ;
116121 }
117122
@@ -186,6 +191,8 @@ function Install-Icinga()
186191 }
187192 }
188193
194+ $Global :Icinga.Protected.ServiceRestartLock = $FALSE ;
195+
189196 if ($null -ne (Get-Command - Name ' Set-IcingaForWindowsManagementConsoleClosing' - ErrorAction SilentlyContinue)) {
190197 Set-IcingaForWindowsManagementConsoleClosing - Completed;
191198 }
0 commit comments