Supress other messages then plugin output

This commit is contained in:
Lord Hepipud 2021-04-23 12:55:05 +02:00
parent 527b3951ba
commit 01b39ea514
3 changed files with 14 additions and 2 deletions

View file

@ -13,6 +13,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
### Enhancements ### Enhancements
* [#228](https://github.com/Icinga/icinga-powershell-framework/issues/228) Adds feature to suppress any kind of console output except for plugin output and performance data
* [#229](https://github.com/Icinga/icinga-powershell-framework/pull/229) CustomFields defined as `SecureString` are now set to `hidden` within the Icinga Director configuration basket - please read the [upgrading docs](30-upgrading-framework.md) carefully * [#229](https://github.com/Icinga/icinga-powershell-framework/pull/229) CustomFields defined as `SecureString` are now set to `hidden` within the Icinga Director configuration basket - please read the [upgrading docs](30-upgrading-framework.md) carefully
* [#234](https://github.com/Icinga/icinga-powershell-framework/pull/234) Adds support to allow custom exception lists for Icinga Exceptions, making it easier for different modules to ship their own exception messages * [#234](https://github.com/Icinga/icinga-powershell-framework/pull/234) Adds support to allow custom exception lists for Icinga Exceptions, making it easier for different modules to ship their own exception messages
* [#235](https://github.com/Icinga/icinga-powershell-framework/pull/235) Adds new Cmdlet `Show-IcingaEventLogAnalysis` to get a better overview on how many log entries are present within the EventLog based on hour, minute and day average/maximum for allowing a more dynamic configuration for `Invoke-IcingaCheckEventLog` * [#235](https://github.com/Icinga/icinga-powershell-framework/pull/235) Adds new Cmdlet `Show-IcingaEventLogAnalysis` to get a better overview on how many log entries are present within the EventLog based on hour, minute and day average/maximum for allowing a more dynamic configuration for `Invoke-IcingaCheckEventLog`

View file

@ -20,6 +20,14 @@ function Use-Icinga()
Disable-IcingaProgressPreference; Disable-IcingaProgressPreference;
if ($Minimal) { if ($Minimal) {
if ($null -eq $global:Icinga) {
$global:Icinga = @{ };
}
if ($global:Icinga.ContainsKey('Minimal') -eq $FALSE) {
$global:Icinga.Add('Minimal', $TRUE);
}
# If we load the minimal Framework files, we have to ensure our enums are loaded # If we load the minimal Framework files, we have to ensure our enums are loaded
Import-Module ([string]::Format('{0}\lib\icinga\exception\Icinga_IcingaExceptionEnums.psm1', $PSScriptRoot)) -Global; Import-Module ([string]::Format('{0}\lib\icinga\exception\Icinga_IcingaExceptionEnums.psm1', $PSScriptRoot)) -Global;
Import-Module ([string]::Format('{0}\lib\icinga\enums\Icinga_IcingaEnums.psm1', $PSScriptRoot)) -Global; Import-Module ([string]::Format('{0}\lib\icinga\enums\Icinga_IcingaEnums.psm1', $PSScriptRoot)) -Global;

View file

@ -5,6 +5,9 @@ function Write-IcingaPluginOutput()
); );
if ($global:IcingaDaemonData.FrameworkRunningAsDaemon -eq $FALSE) { if ($global:IcingaDaemonData.FrameworkRunningAsDaemon -eq $FALSE) {
if ($null -ne $global:Icinga -And $global:Icinga.Minimal) {
Clear-Host;
}
Write-IcingaConsolePlain $Output; Write-IcingaConsolePlain $Output;
} else { } else {
# New behavior with local thread separated results # New behavior with local thread separated results