Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Adds support to keep IMC console output #429

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/core/installer/Install-Icinga.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function Install-Icinga()
$global:Icinga.Add(
'InstallWizard', @{
'AdminShell' = (Test-AdministrativeShell);
'BlockClearHost' = $FALSE;
'LastInput' = '';
'LastNotice' = '';
'LastError' = '';
Expand Down
14 changes: 11 additions & 3 deletions lib/core/installer/Start-IcingaForWindowsInstallation.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function Start-IcingaForWindowsInstallation()
[switch]$Automated
);

if ($global:Icinga.InstallWizard.DirectorInstallError -eq $FALSE -And (Get-IcingaFrameworkDebugMode) -eq $FALSE) {
if ($global:Icinga.InstallWizard.DirectorInstallError -eq $FALSE -And (Get-IcingaFrameworkDebugMode) -eq $FALSE -And $global:Icinga.InstallWizard.BlockClearHost -eq $FALSE) {
Clear-Host;
}

Expand Down Expand Up @@ -264,6 +264,14 @@ function Start-IcingaForWindowsInstallation()
Start-Sleep -Seconds 5;
}

$global:Icinga.InstallWizard.NextCommand = 'Install-Icinga';
$global:Icinga.InstallWizard.NextArguments = @{ };
$global:Icinga.InstallWizard.NextCommand = 'Install-Icinga';
$global:Icinga.InstallWizard.NextArguments = @{ };

$BlockClearHost = Get-IcingaForWindowsInstallerStepSelection -InstallerStep 'Show-IcingaForWindowsInstallerMenuBlockClearHost';

if ($BlockClearHost -eq 0) {
$global:Icinga.InstallWizard.BlockClearHost = $FALSE;
} else {
$global:Icinga.InstallWizard.BlockClearHost = $TRUE;
}
}
1 change: 1 addition & 0 deletions lib/core/installer/menu/installation/AdvancedEntries.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ function Add-IcingaForWindowsInstallationAdvancedEntries()
Show-IcingaForWindowsInstallationMenuStableRepository -Automated -Advanced;
Show-IcingaForWindowsInstallerMenuSelectInstallJEAProfile -Automated -Advanced;
Show-IcingaForWindowsInstallationMenuEnterIcingaCAServer -Automated -Advanced;
Show-IcingaForWindowsInstallerMenuBlockClearHost -Automated -Advanced;

Enable-IcingaFrameworkConsoleOutput;

Expand Down
32 changes: 32 additions & 0 deletions lib/core/installer/menu/manage/framework/BlockClearHost.psm1
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
function Show-IcingaForWindowsInstallerMenuBlockClearHost()
{
param (
[array]$Value = @(),
[string]$DefaultInput = '0',
[switch]$JumpToSummary = $FALSE,
[switch]$Automated = $FALSE,
[switch]$Advanced = $FALSE
);

Show-IcingaForWindowsInstallerMenu `
-Header 'Clear the console output before running the installation' `
-Entries @(
@{
'Caption' = 'Clear console';
'Command' = 'Show-IcingaForWindowsInstallerConfigurationSummary';
'Help' = 'This will clear the current text of the console for a clean installation view and clear it afterwards as well';
},
@{
'Caption' = 'Do not clear console';
'Command' = 'Show-IcingaForWindowsInstallerConfigurationSummary';
'Help' = 'This will leave the console output on the console between installation steps and afterwards to possible debug purpose';
}
) `
-DefaultIndex $DefaultInput `
-JumpToSummary:$FALSE `
-ConfigElement `
-Automated:$Automated `
-Advanced:$Advanced;
}

Set-Alias -Name 'IfW-BlockClearHost' -Value 'Show-IcingaForWindowsInstallerMenuBlockClearHost';
2 changes: 1 addition & 1 deletion lib/core/installer/tools/ShowInstallerMenu.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function Show-IcingaForWindowsInstallerMenu()
[switch]$NoConfigSwap = $FALSE
);

if ($global:Icinga.InstallWizard.DirectorInstallError -eq $FALSE -And (Test-IcingaForWindowsInstallationHeaderPrint) -eq $FALSE -And (Get-IcingaFrameworkDebugMode) -eq $FALSE) {
if ($global:Icinga.InstallWizard.DirectorInstallError -eq $FALSE -And (Test-IcingaForWindowsInstallationHeaderPrint) -eq $FALSE -And (Get-IcingaFrameworkDebugMode) -eq $FALSE -And $global:Icinga.InstallWizard.BlockClearHost -eq $FALSE) {
Clear-Host;
}

Expand Down