mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Merge pull request #338 from Icinga:feature/mmc_overview_kickstartfilter
Style: Adds mmc list view, kickstart filter, spelling fix Fixes plenty of spelling mistakes, style guides, views, layouts and other visual topics for the Icinga for Windows Management Console.
This commit is contained in:
commit
30107e8e32
19 changed files with 200 additions and 67 deletions
|
|
@ -20,7 +20,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
|
|||
* [#328](https://github.com/Icinga/icinga-powershell-framework/pull/328) Fixes installer while using installation files or the installation command, which did not overwrite default values with custom values
|
||||
* [#330](https://github.com/Icinga/icinga-powershell-framework/pull/330) Fixes `Remove-ItemSecure` which was not using all args and might fail on empty path entries
|
||||
* [#332](https://github.com/Icinga/icinga-powershell-framework/pull/332) Fixes Icinga Director Self-Service ticket handling, which was not working within the Icinga Management Console
|
||||
* [#335](https://github.com/Icinga/icinga-powershell-framework/pull/335) Fixex Icinga Director Self-Service Zones and CA config for legacy installation wizard
|
||||
* [#335](https://github.com/Icinga/icinga-powershell-framework/pull/335) Fixes Icinga Director Self-Service Zones and CA config for legacy installation wizard
|
||||
|
||||
### Enhancements
|
||||
|
||||
|
|
@ -35,6 +35,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
|
|||
* [#322](https://github.com/Icinga/icinga-powershell-framework/pull/322) Remove legacy import feature from Framework and replace it with a dummy function, as no longer required by Icinga for Windows
|
||||
* [#323](https://github.com/Icinga/icinga-powershell-framework/pull/323) Adds `-RebuildCache` switch to `icinga` command alias and `Invoke-IcingaCommand`, for quicker cache re-creation for developers
|
||||
* [#333](https://github.com/Icinga/icinga-powershell-framework/pull/333) Adds Cmdlet `Test-IcingaForWindowsService` to test the Icinga for Windows service configuration
|
||||
* [#338](https://github.com/Icinga/icinga-powershell-framework/pull/338) Improves various styles, outputs and view for the Icinga for Windows Management Console and fixes some spelling mistakes
|
||||
|
||||
## 1.5.2 (2021-07-09)
|
||||
|
||||
|
|
|
|||
|
|
@ -46,9 +46,9 @@ Which version of the "Icinga Framework" do you want to install? (release/snapsho
|
|||
[Notice]: Framework update has been completed. Please start a new PowerShell instance now to complete the update
|
||||
[Passed]: Icinga Agent service is installed
|
||||
[Passed]: The specified user "NT Authority\NetworkService" is allowed to run as service
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\etc" is accessible and writeable by the Icinga Service User "NT Authority\NetworkService"
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\var" is accessible and writeable by the Icinga Service User "NT Authority\NetworkService"
|
||||
[Passed]: Directory "C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache" is accessible and writeable by the Icinga Service User "NT Authority\NetworkService"
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\etc" is accessible and writable by the Icinga Service User "NT Authority\NetworkService"
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\var" is accessible and writable by the Icinga Service User "NT Authority\NetworkService"
|
||||
[Passed]: Directory "C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache" is accessible and writable by the Icinga Service User "NT Authority\NetworkService"
|
||||
[Passed]: Icinga Agent configuration is valid
|
||||
[Passed]: Icinga Agent debug log is disabled
|
||||
[Notice]: Starting Icinga Agent service
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@ Once executed you will receive a status of tests which are performed:
|
|||
```text
|
||||
[Passed]: Icinga Agent service is installed
|
||||
[Passed]: The specified user "NT AUTHORITY\NetworkService" is allowed to run as service
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\etc" is accessible and writeable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\var" is accessible and writeable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Directory "C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache" is accessible and writeable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\etc" is accessible and writable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\var" is accessible and writable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Directory "C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache" is accessible and writable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Icinga Agent configuration is valid
|
||||
[Passed]: Icinga Agent debug log is disabled
|
||||
```
|
||||
|
|
@ -29,9 +29,9 @@ In order to make the Icinga Agent and the Icinga PowerShell Framework work prope
|
|||
```text
|
||||
[Passed]: Icinga Agent service is installed
|
||||
[Passed]: The specified user "NT AUTHORITY\NetworkService" is allowed to run as service
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\etc" is accessible and writeable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\var" is accessible and writeable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Directory "C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache" is accessible and writeable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\etc" is accessible and writable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\var" is accessible and writable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Directory "C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache" is accessible and writable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Icinga Agent configuration is valid
|
||||
[Warning]: The debug log of the Icinga Agent is enabled. Please keep in mind to disable it once testing is done, as a huge amount of data is generated
|
||||
```
|
||||
|
|
@ -43,10 +43,10 @@ In addition for testing, the Icinga PowerShell Framework will suggest methods to
|
|||
```text
|
||||
[Passed]: Icinga Agent service is installed
|
||||
[Passed]: The specified user "NT AUTHORITY\NetworkService" is allowed to run as service
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\etc" is accessible and writeable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\etc" is accessible and writable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Failed]: Directory "C:\ProgramData\icinga2\var" is not accessible by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
\_ Please run the following command to fix this issue: Set-IcingaAcl -Directory 'C:\ProgramData\icinga2\var'
|
||||
[Passed]: Directory "C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache" is accessible and writeable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Directory "C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache" is accessible and writable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Icinga Agent configuration is valid
|
||||
[Passed]: Icinga Agent debug log is disabled
|
||||
```
|
||||
|
|
@ -58,7 +58,7 @@ Set-IcingaAcl -Directory 'C:\ProgramData\icinga2\var';
|
|||
```
|
||||
|
||||
```text
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\var" is accessible and writeable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\var" is accessible and writable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
```
|
||||
|
||||
Now if we run the test again, the issue is resolved:
|
||||
|
|
@ -66,9 +66,9 @@ Now if we run the test again, the issue is resolved:
|
|||
```text
|
||||
[Passed]: Icinga Agent service is installed
|
||||
[Passed]: The specified user "NT AUTHORITY\NetworkService" is allowed to run as service
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\etc" is accessible and writeable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\var" is accessible and writeable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Directory "C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache" is accessible and writeable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\etc" is accessible and writable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\var" is accessible and writable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Directory "C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache" is accessible and writable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Icinga Agent configuration is valid
|
||||
[Passed]: Icinga Agent debug log is disabled
|
||||
```
|
||||
|
|
@ -84,9 +84,9 @@ Test-IcingaAgent;`
|
|||
```text
|
||||
[Passed]: Icinga Agent service is installed
|
||||
[Passed]: The specified user "NT AUTHORITY\NetworkService" is allowed to run as service
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\etc" is accessible and writeable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\var" is accessible and writeable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Directory "C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache" is accessible and writeable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\etc" is accessible and writable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\var" is accessible and writable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Passed]: Directory "C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache" is accessible and writable by the Icinga Service User "NT AUTHORITY\NetworkService"
|
||||
[Failed]: Icinga Agent configuration contains errors. Run this command for getting a detailed error report: "Test-IcingaAgentConfig -WriteStackTrace | Out-Null"
|
||||
[Passed]: Icinga Agent debug log is disabled
|
||||
```
|
||||
|
|
|
|||
|
|
@ -33,9 +33,9 @@ Set-IcingaAgentServiceUser -User 'NT AUTHORITY\SYSTEM' -SetPermission;
|
|||
|
||||
```text
|
||||
[Notice]: The Icinga Service User already has permission to run as service
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\etc" is accessible and writeable by the Icinga Service User "NT AUTHORITY\SYSTEM"
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\var" is accessible and writeable by the Icinga Service User "NT AUTHORITY\SYSTEM"
|
||||
[Passed]: Directory "C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache" is accessible and writeable by the Icinga Service User "NT AUTHORITY\SYSTEM"
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\etc" is accessible and writable by the Icinga Service User "NT AUTHORITY\SYSTEM"
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\var" is accessible and writable by the Icinga Service User "NT AUTHORITY\SYSTEM"
|
||||
[Passed]: Directory "C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache" is accessible and writable by the Icinga Service User "NT AUTHORITY\SYSTEM"
|
||||
[Notice]: Service User successfully updated
|
||||
```
|
||||
|
||||
|
|
@ -64,7 +64,7 @@ If we how ever run our Cmdlet `Test-IcingaAgent` (which is described [here](32-T
|
|||
|
||||
```text
|
||||
[Failed]: The specified user "icinga" is not allowed to run as service
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\etc" is accessible and writeable by the Icinga Service User "icinga"
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\etc" is accessible and writable by the Icinga Service User "icinga"
|
||||
[Failed]: Directory "C:\ProgramData\icinga2\var" is not accessible by the Icinga Service User "icinga"
|
||||
\_ Please run the following command to fix this issue: Set-IcingaAcl -Directory 'C:\ProgramData\icinga2\var'
|
||||
```
|
||||
|
|
@ -78,9 +78,9 @@ Set-IcingaAgentServiceUser -User $cred.UserName -Password $cred.Password -SetPer
|
|||
|
||||
```text
|
||||
[Passed]: The specified user "icinga" is allowed to run as service
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\etc" is accessible and writeable by the Icinga Service User "icinga"
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\var" is accessible and writeable by the Icinga Service User "icinga"
|
||||
[Passed]: Directory "C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache" is accessible and writeable by the Icinga Service User "icinga"
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\etc" is accessible and writable by the Icinga Service User "icinga"
|
||||
[Passed]: Directory "C:\ProgramData\icinga2\var" is accessible and writable by the Icinga Service User "icinga"
|
||||
[Passed]: Directory "C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache" is accessible and writable by the Icinga Service User "icinga"
|
||||
[Notice]: Service User successfully updated
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -38,9 +38,9 @@ function Test-IcingaAcl()
|
|||
[string]$messageFormat = 'Directory "{0}" {1} by the Icinga Service User "{2}"';
|
||||
if ($UserFound) {
|
||||
if ($HasAccess) {
|
||||
Write-IcingaTestOutput -Severity 'Passed' -Message ([string]::Format($messageFormat, $Directory, 'is accessible and writeable', $ServiceUser));
|
||||
Write-IcingaTestOutput -Severity 'Passed' -Message ([string]::Format($messageFormat, $Directory, 'is accessible and writable', $ServiceUser));
|
||||
} else {
|
||||
Write-IcingaTestOutput -Severity 'Failed' -Message ([string]::Format($messageFormat, $Directory, 'is accessible but NOT writeable', $ServiceUser));
|
||||
Write-IcingaTestOutput -Severity 'Failed' -Message ([string]::Format($messageFormat, $Directory, 'is accessible but NOT writable', $ServiceUser));
|
||||
Write-IcingaConsolePlain "\_ Please run the following command to fix this issue: Set-IcingaAcl -Directory '$Directory'";
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -103,14 +103,22 @@ function Install-Icinga()
|
|||
'Help' = 'Allows you to install Icinga for Windows with all required components and options.'
|
||||
},
|
||||
@{
|
||||
'Caption' = 'Install Components';
|
||||
'Command' = 'Show-IcingaForWindowsMenuInstallComponents';
|
||||
'Help' = 'Allows you to install new components for Icinga for Windows from your repositories.';
|
||||
'Caption' = 'Install components';
|
||||
'Command' = 'Show-IcingaForWindowsMenuInstallComponents';
|
||||
'Help' = 'Allows you to install new components for Icinga for Windows from your repositories.';
|
||||
'Disabled' = (-Not ($global:Icinga.InstallWizard.AdminShell));
|
||||
},
|
||||
@{
|
||||
'Caption' = 'Update environment';
|
||||
'Command' = 'Show-IcingaForWindowsMenuUpdateComponents';
|
||||
'Help' = 'Allows you to modify your current Icinga for Windows installation.';
|
||||
'Caption' = 'Update components';
|
||||
'Command' = 'Show-IcingaForWindowsMenuUpdateComponents';
|
||||
'Help' = 'Allows you to modify your current Icinga for Windows installation.';
|
||||
'Disabled' = (-Not ($global:Icinga.InstallWizard.AdminShell));
|
||||
},
|
||||
@{
|
||||
'Caption' = 'Remove components';
|
||||
'Command' = 'Show-IcingaForWindowsMenuRemoveComponents';
|
||||
'Help' = 'Allows you to modify your current Icinga for Windows installation.';
|
||||
'Disabled' = (-Not ($global:Icinga.InstallWizard.AdminShell));
|
||||
},
|
||||
@{
|
||||
'Caption' = 'Manage environment';
|
||||
|
|
@ -118,10 +126,9 @@ function Install-Icinga()
|
|||
'Help' = 'Allows you to modify your current Icinga for Windows installation.';
|
||||
},
|
||||
@{
|
||||
'Caption' = 'Remove components';
|
||||
'Command' = 'Show-IcingaForWindowsMenuRemoveComponents';
|
||||
'Help' = 'Allows you to modify your current Icinga for Windows installation.';
|
||||
'Disabled' = (-Not ($global:Icinga.InstallWizard.AdminShell));
|
||||
'Caption' = 'List environment';
|
||||
'Command' = 'Show-IcingaForWindowsMenuListEnvironment';
|
||||
'Help' = 'Shows you an overview of your current Icinga for Windows installation, including installed components and system informations.';
|
||||
}
|
||||
) `
|
||||
-DefaultIndex 0;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ function Show-IcingaForWindowsInstallerMenuInstallWindows()
|
|||
'Disabled' = ([bool]($null -eq (Get-IcingaPowerShellConfig -Path 'Framework.Config.Swap')));
|
||||
},
|
||||
@{
|
||||
'Caption' = 'Reconfigure Environment';
|
||||
'Caption' = 'Reconfigure environment';
|
||||
'Command' = 'Invoke-IcingaForWindowsManagementConsoleReconfigureAgent';
|
||||
'Help' = 'Load the current configuration of Icinga for Windows to modify it.';
|
||||
'Disabled' = ([bool]($null -eq (Get-IcingaPowerShellConfig -Path 'Framework.Config.Live')));
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
function Show-IcingaForWindowsManagementConsoleInstallationConfigString()
|
||||
{
|
||||
[string]$ConfigurationString = [string]::Format(
|
||||
"{0}Install-Icinga -InstallCommand '{1}'{0}",
|
||||
(New-IcingaNewLine),
|
||||
"Install-Icinga -InstallCommand '{0}'",
|
||||
(Get-IcingaForWindowsManagementConsoleConfigurationString -Compress)
|
||||
);
|
||||
|
||||
|
|
@ -23,5 +22,6 @@ function Show-IcingaForWindowsManagementConsoleInstallationConfigString()
|
|||
-ConfigLimit 1 `
|
||||
-DefaultIndex 'c' `
|
||||
-ReadOnly `
|
||||
-PlainTextOutput `
|
||||
-Hidden;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,4 +29,4 @@ function Show-IcingaForWindowsInstallerMenuSelectInstallIcingaForWindowsService(
|
|||
-Advanced:$Advanced;
|
||||
}
|
||||
|
||||
Set-Alias -Name 'IfW-InstallPowerShellService' -Value 'Show-IcingaForWindowsInstallerMenuSelectInstallIcingaForWindowsService';
|
||||
Set-Alias -Name 'IfW-InstallService' -Value 'Show-IcingaForWindowsInstallerMenuSelectInstallIcingaForWindowsService';
|
||||
19
lib/core/installer/menu/manage/general/ListOverview.psm1
Normal file
19
lib/core/installer/menu/manage/general/ListOverview.psm1
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
function Show-IcingaForWindowsMenuListEnvironment()
|
||||
{
|
||||
Show-IcingaForWindowsInstallerMenu `
|
||||
-Header 'Icinga for Windows environment overview:' `
|
||||
-Entries @(
|
||||
@{
|
||||
'Caption' = '';
|
||||
'Command' = 'Install-Icinga';
|
||||
'Help' = 'A summary of your current Icinga for Windows installation';
|
||||
}
|
||||
) `
|
||||
-AddConfig `
|
||||
-DefaultValues @(([string]::Join("`n", (Show-Icinga -SkipHeader)))) `
|
||||
-ConfigLimit 1 `
|
||||
-DefaultIndex 'c' `
|
||||
-ReadOnly `
|
||||
-PlainTextOutput `
|
||||
-Hidden;
|
||||
}
|
||||
|
|
@ -15,9 +15,10 @@ function Show-IcingaForWindowsInstallerMenu()
|
|||
[string]$ContinueFunction = $null,
|
||||
[switch]$ConfigElement = $FALSE,
|
||||
[switch]$HiddenConfigElement = $FALSE,
|
||||
[switch]$ReadOnly = $FALSE,
|
||||
[switch]$ReadOnly = $FALSE,
|
||||
[switch]$Automated = $FALSE,
|
||||
[switch]$Advanced = $FALSE
|
||||
[switch]$Advanced = $FALSE,
|
||||
[switch]$PlainTextOutput = $FALSE
|
||||
);
|
||||
|
||||
if ((Test-IcingaForWindowsInstallationHeaderPrint) -eq $FALSE -And (Get-IcingaFrameworkDebugMode) -eq $FALSE) {
|
||||
|
|
@ -83,19 +84,18 @@ function Show-IcingaForWindowsInstallerMenu()
|
|||
);
|
||||
|
||||
if ($global:Icinga.InstallWizard.AdminShell -eq $FALSE) {
|
||||
$ConsoleHeaderLines += '[Warning]: Run this shell as Administrator to unlock all features'
|
||||
$ConsoleHeaderLines += '[Warning]: Run this shell with administrative privileges to unlock all features'
|
||||
}
|
||||
|
||||
$ConsoleHeaderLines += @(
|
||||
'This is an experimental feature and might contain bugs',
|
||||
'Please provide us with feedback, issues and input at',
|
||||
'https://github.com/Icinga/icinga-powershell-framework/issues'
|
||||
)
|
||||
if ($PSVersionTable.PSVersion -lt '5.0.0.0') {
|
||||
$ConsoleHeaderLines += ([string]::Format('[Warning]: Update to PowerShell version >=5.0 from currently {0} to unlock all features (like JEA)', $PSVersionTable.PSVersion.ToString(2)));
|
||||
}
|
||||
|
||||
Write-IcingaConsoleHeader -HeaderLines $ConsoleHeaderLines;
|
||||
|
||||
Write-IcingaConsolePlain '';
|
||||
Write-IcingaConsolePlain $Header;
|
||||
|
||||
Write-IcingaConsolePlain '';
|
||||
}
|
||||
|
||||
|
|
@ -144,10 +144,14 @@ function Show-IcingaForWindowsInstallerMenu()
|
|||
}
|
||||
|
||||
if ($StoredValues.Count -ne 0) {
|
||||
if ($PasswordInput -eq $FALSE) {
|
||||
Write-IcingaConsolePlain ([string]::Format(' {0}', (ConvertFrom-IcingaArrayToString -Array $StoredValues -AddQuotes))) -ForeColor Cyan;
|
||||
if ($PlainTextOutput) {
|
||||
Write-IcingaConsolePlain (ConvertFrom-IcingaArrayToString -Array $StoredValues) -ForeColor Cyan;
|
||||
} else {
|
||||
Write-IcingaConsolePlain ([string]::Format(' {0}', (ConvertFrom-IcingaArrayToString -Array $StoredValues -AddQuotes -SecureContent))) -ForeColor Cyan;
|
||||
if ($PasswordInput -eq $FALSE) {
|
||||
Write-IcingaConsolePlain ([string]::Format(' {0}', (ConvertFrom-IcingaArrayToString -Array $StoredValues -AddQuotes))) -ForeColor Cyan;
|
||||
} else {
|
||||
Write-IcingaConsolePlain ([string]::Format(' {0}', (ConvertFrom-IcingaArrayToString -Array $StoredValues -AddQuotes -SecureContent))) -ForeColor Cyan;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -163,7 +167,11 @@ function Show-IcingaForWindowsInstallerMenu()
|
|||
Write-IcingaConsolePlain '';
|
||||
|
||||
if ($global:Icinga.InstallWizard.DisplayAdvanced) {
|
||||
$MenuNavigation = [string]::Format('{0} [a] Advanced', $MenuNavigation)
|
||||
if ($global:Icinga.InstallWizard.ShowAdvanced -eq $FALSE) {
|
||||
$MenuNavigation = [string]::Format('{0} [a] Advanced', $MenuNavigation)
|
||||
} else {
|
||||
$MenuNavigation = [string]::Format('{0} [a] Hide Advanced', $MenuNavigation)
|
||||
}
|
||||
}
|
||||
|
||||
$MenuNavigation = [string]::Format('{0} [c] Continue', $MenuNavigation)
|
||||
|
|
@ -172,7 +180,11 @@ function Show-IcingaForWindowsInstallerMenu()
|
|||
$MenuNavigation = [string]::Format('{0} [d] Delete', $MenuNavigation)
|
||||
}
|
||||
|
||||
$MenuNavigation = [string]::Format('{0} [h] Help [m] Main', $MenuNavigation)
|
||||
if ($global:Icinga.InstallWizard.ShowHelp -eq $FALSE) {
|
||||
$MenuNavigation = [string]::Format('{0} [h] Help [m] Main', $MenuNavigation)
|
||||
} else {
|
||||
$MenuNavigation = [string]::Format('{0} [h] Hide Help [m] Main', $MenuNavigation)
|
||||
}
|
||||
|
||||
if ([string]::IsNullOrEmpty($LastParent) -eq $FALSE -Or $global:Icinga.InstallWizard.LastParent.Count -gt 1) {
|
||||
$MenuNavigation = [string]::Format('{0} [p] Previous', $MenuNavigation)
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ function Write-IcingaConsoleOutput()
|
|||
[array]$Objects,
|
||||
[ValidateSet('Default', 'Black', 'DarkBlue', 'DarkGreen', 'DarkCyan', 'DarkRed', 'DarkMagenta', 'DarkYellow', 'Gray', 'DarkGray', 'Blue', 'Green', 'Cyan', 'Red', 'Magenta', 'Yellow', 'White')]
|
||||
[string]$ForeColor = 'Default',
|
||||
[string]$Severity = 'Notice'
|
||||
[string]$Severity = 'Notice',
|
||||
[switch]$NoNewLine = $FALSE
|
||||
);
|
||||
|
||||
if ((Test-IcingaFrameworkConsoleOutput) -eq $FALSE) {
|
||||
|
|
@ -67,8 +68,8 @@ function Write-IcingaConsoleOutput()
|
|||
}
|
||||
|
||||
if ($ForeColor -eq 'Default') {
|
||||
Write-Host $OutputMessage;
|
||||
Write-Host $OutputMessage -NoNewline:$NoNewLine;
|
||||
} else {
|
||||
Write-Host $OutputMessage -ForegroundColor $ForeColor;
|
||||
Write-Host $OutputMessage -ForegroundColor $ForeColor -NoNewline:$NoNewLine;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,12 +25,14 @@ function Write-IcingaConsolePlain()
|
|||
[string]$Message,
|
||||
[array]$Objects,
|
||||
[ValidateSet('Default', 'Black', 'DarkBlue', 'DarkGreen', 'DarkCyan', 'DarkRed', 'DarkMagenta', 'DarkYellow', 'Gray', 'DarkGray', 'Blue', 'Green', 'Cyan', 'Red', 'Magenta', 'Yellow', 'White')]
|
||||
[string]$ForeColor = 'Default'
|
||||
[string]$ForeColor = 'Default',
|
||||
[switch]$NoNewLine = $FALSE
|
||||
);
|
||||
|
||||
Write-IcingaConsoleOutput `
|
||||
-Message $Message `
|
||||
-Objects $Objects `
|
||||
-ForeColor $ForeColor `
|
||||
-Severity $null;
|
||||
-Severity $null `
|
||||
-NoNewLine:$NoNewLine;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,22 @@ function Get-IcingaRepositoryPackage()
|
|||
|
||||
if ([string]::IsNullOrEmpty($Name)) {
|
||||
Write-IcingaConsoleError 'You have to provide a component name';
|
||||
return;
|
||||
|
||||
return @{
|
||||
'HasPackage' = $FALSE;
|
||||
'Package' = $null;
|
||||
'Source' = $null;
|
||||
'Repository' = $null;
|
||||
};
|
||||
}
|
||||
|
||||
if ($Name.ToLower() -eq 'kickstart') {
|
||||
return @{
|
||||
'HasPackage' = $FALSE;
|
||||
'Package' = $null;
|
||||
'Source' = $null;
|
||||
'Repository' = $null;
|
||||
};
|
||||
}
|
||||
|
||||
$Repositories = Get-IcingaRepositories -ExcludeDisabled;
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ function Search-IcingaRepository()
|
|||
|
||||
foreach ($repoEntry in $RepoContent.Packages.PSObject.Properties.Name) {
|
||||
|
||||
if ($repoEntry -NotLike $Name) {
|
||||
if ($repoEntry -NotLike $Name -Or $Name.ToLower() -eq 'kickstart') {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,39 @@
|
|||
function Show-Icinga()
|
||||
{
|
||||
param (
|
||||
[switch]$SkipHeader = $FALSE
|
||||
);
|
||||
|
||||
$IcingaInstallation = Get-IcingaInstallation -Release;
|
||||
[array]$Output = @( 'Icinga for Windows environment' );
|
||||
[array]$VersionList = @();
|
||||
[int]$MaxComponentLength = Get-IcingaMaxTextLength -TextArray $IcingaInstallation.Keys;
|
||||
[int]$MaxVersionLength = Get-IcingaMaxTextLength -TextArray $IcingaInstallation.Values.CurrentVersion;
|
||||
|
||||
foreach ($entry in $IcingaInstallation.Keys) {
|
||||
$LockVersion = Get-IcingaComponentLock -Name $entry;
|
||||
|
||||
if ($null -eq $LockVersion) {
|
||||
$VersionList += [string]$IcingaInstallation[$entry].CurrentVersion;
|
||||
continue;
|
||||
}
|
||||
|
||||
$VersionList += ([string]::Format('{0}*', $IcingaInstallation[$entry].CurrentVersion));
|
||||
}
|
||||
|
||||
[int]$MaxVersionLength = Get-IcingaMaxTextLength -TextArray $VersionList;
|
||||
[string]$ComponentHeader = Add-IcingaWhiteSpaceToString -Text 'Component' -Length $MaxComponentLength;
|
||||
[string]$ComponentLine = Add-IcingaWhiteSpaceToString -Text '---' -Length $MaxComponentLength;
|
||||
$Output += '-----------';
|
||||
$Output += '';
|
||||
|
||||
if ($SkipHeader) {
|
||||
[array]$Output = @();
|
||||
}
|
||||
|
||||
$Output += 'Installed components on this system';
|
||||
$Output += '';
|
||||
$Output += [string]::Format('{0} {1} Available', $ComponentHeader, ((Add-IcingaWhiteSpaceToString -Text 'Version' -Length $MaxVersionLength)));
|
||||
$Output += [string]::Format('{0} {1} ---', $ComponentLine, ((Add-IcingaWhiteSpaceToString -Text '---' -Length $MaxVersionLength)));
|
||||
$Output += [string]::Format('{0} {1} ---', $ComponentLine, ((Add-IcingaWhiteSpaceToString -Text '---' -Length $MaxVersionLength)));
|
||||
|
||||
foreach ($component in $IcingaInstallation.Keys) {
|
||||
$Data = $IcingaInstallation[$component];
|
||||
|
|
@ -27,7 +49,7 @@ function Show-Icinga()
|
|||
}
|
||||
|
||||
[string]$ComponentName = Add-IcingaWhiteSpaceToString -Text $component -Length $MaxComponentLength;
|
||||
$Output += [string]::Format('{0} {1} {2}', $ComponentName, (Add-IcingaWhiteSpaceToString -Text $CurrentVersion -Length $MaxVersionLength), $LatestVersion);
|
||||
$Output += [string]::Format('{0} {1} {2}', $ComponentName, (Add-IcingaWhiteSpaceToString -Text $CurrentVersion -Length $MaxVersionLength), $LatestVersion);
|
||||
}
|
||||
|
||||
$Output += '';
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ function Add-IcingaWhiteSpaceToString()
|
|||
|
||||
[int]$LengthOffset = $Length - $Text.Length;
|
||||
|
||||
while ($LengthOffset -gt 0) {
|
||||
while ($LengthOffset -ge 0) {
|
||||
$Text += ' ';
|
||||
$LengthOffset -= 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ function Write-IcingaConsoleHeader()
|
|||
[int]$MaxHeaderLength = 0;
|
||||
[int]$TableHeaderCount = 0;
|
||||
[array]$TableHeader = @();
|
||||
[array]$SeverityData = @();
|
||||
|
||||
Import-LocalizedData `
|
||||
-BaseDirectory (Get-IcingaFrameworkRootPath) `
|
||||
|
|
@ -24,6 +25,10 @@ function Write-IcingaConsoleHeader()
|
|||
}
|
||||
|
||||
foreach ($line in $ParsedHeaders) {
|
||||
if ($line.Contains('[Notice]') -Or $line.Contains('[Warning]') -Or $line.Contains('Error')) {
|
||||
continue
|
||||
}
|
||||
|
||||
if ($MaxHeaderLength -lt $line.Length) {
|
||||
$MaxHeaderLength = $line.Length
|
||||
}
|
||||
|
|
@ -61,8 +66,34 @@ function Write-IcingaConsoleHeader()
|
|||
}
|
||||
}
|
||||
}
|
||||
Write-IcingaConsolePlain -Message '**{1} {0} {2}**' -Objects $line, ([string]::Join('', $LeftSpacing)), ([string]::Join('', $RightSpacing));
|
||||
|
||||
if ($line.Contains('[Notice]') -Or $line.Contains('[Warning]') -Or $line.Contains('Error')) {
|
||||
$SeverityData += $line;
|
||||
continue;
|
||||
}
|
||||
|
||||
$HeaderMessage = [string]::Format('**{1} {0} {2}**', $line, ([string]::Join('', $LeftSpacing)), ([string]::Join('', $RightSpacing)));
|
||||
|
||||
Write-IcingaConsolePlain -Message $HeaderMessage;
|
||||
}
|
||||
|
||||
Write-IcingaConsolePlain ([string]::Join('', $TableHeader));
|
||||
|
||||
if ($SeverityData.Count -ne 0) {
|
||||
Write-IcingaConsolePlain -Message '';
|
||||
|
||||
foreach ($entry in $SeverityData) {
|
||||
if (Write-IcingaConsoleTextColorSplit -Pattern '[Warning]' -Message $entry -ForeColor 'DarkYellow') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Write-IcingaConsoleTextColorSplit -Pattern '[Error]' -Message $entry -ForeColor 'Red') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Write-IcingaConsoleTextColorSplit -Pattern '[Notice]' -Message $entry -ForeColor 'Green') {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
23
lib/core/tools/Write-IcingaConsoleTextColorSplit.psm1
Normal file
23
lib/core/tools/Write-IcingaConsoleTextColorSplit.psm1
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
function Write-IcingaConsoleTextColorSplit()
|
||||
{
|
||||
param (
|
||||
[string]$Pattern = '',
|
||||
[string]$Message = '',
|
||||
[ValidateSet('Default', 'Black', 'DarkBlue', 'DarkGreen', 'DarkCyan', 'DarkRed', 'DarkMagenta', 'DarkYellow', 'Gray', 'DarkGray', 'Blue', 'Green', 'Cyan', 'Red', 'Magenta', 'Yellow', 'White')]
|
||||
[string]$ForeColor = 'Default'
|
||||
);
|
||||
|
||||
if ($Message.Contains($Pattern)) {
|
||||
[int]$RemoveLength = $Pattern.Length;
|
||||
[string]$SeverityMsg = $Pattern;
|
||||
Write-IcingaConsolePlain -Message ($Message.Substring(0, $Message.IndexOf($Pattern))) -NoNewLine;
|
||||
|
||||
Write-IcingaConsolePlain -Message $SeverityMsg -ForeColor $ForeColor -NoNewLine;
|
||||
|
||||
Write-IcingaConsolePlain -Message ($Message.Substring($Message.IndexOf($Pattern) + $RemoveLength, $Message.Length - $Message.IndexOf($Pattern) - $RemoveLength));
|
||||
|
||||
return $TRUE;
|
||||
}
|
||||
|
||||
return $FALSE;
|
||||
}
|
||||
Loading…
Reference in a new issue