mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-23 16:19:37 -05:00
Merge pull request #451 from Icinga:fix/jea_error_on_no_modules_and_output
Fix: JEA context cannot be created and command not found output Fixes the PowerShell not being able to enter the JEA context, if only the Icinga PowerShell Framework is installed and no other component like plugins being present. Fixes in addition the output for the JEA PowerShell, in case a check command cannot be executed. Previously the pipe `|` for performance data was always added, which is now gone.
This commit is contained in:
commit
c8e8683390
3 changed files with 16 additions and 3 deletions
|
|
@ -32,6 +32,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
|
|||
* [#441](https://github.com/Icinga/icinga-powershell-framework/pull/441) Fixes an exception while loading the Framework, caused by a race condition for missing environment variables which are accessed by some plugins before the Framework is loaded properly
|
||||
* [#446](https://github.com/Icinga/icinga-powershell-framework/pull/446) Fixes Icinga for Windows progress preference, which sometimes caused UI glitches
|
||||
* [#449](https://github.com/Icinga/icinga-powershell-framework/pull/449) Fixes unhandled exception while importing modules during `Install-IcingaComponent` process, because of possible missing dependencies
|
||||
* [#451](https://github.com/Icinga/icinga-powershell-framework/pull/451) Fixes PowerShell being unable to enter JEA context if only the Framework is installed and removes the `|` from plugin output, in case a JEA error is thrown that check commands are not present
|
||||
|
||||
### Enhancements
|
||||
|
||||
|
|
|
|||
|
|
@ -154,6 +154,13 @@ function Get-IcingaJEAConfiguration()
|
|||
-CmdName 'Add-IcingaForWindowsDaemon' `
|
||||
-CmdType 'Function';
|
||||
|
||||
# Fixes error if only the Icinga PowerShell Framework is installed, which then causes JEA to fail entirely because of this missing Cmdlet
|
||||
$UsedCmdlets = Get-IcingaCommandDependency `
|
||||
-DependencyList $DependencyList `
|
||||
-CompiledList $UsedCmdlets `
|
||||
-CmdName 'Select-Object' `
|
||||
-CmdType 'Cmdlet';
|
||||
|
||||
# Finally loop through all commands again and build our JEA command list
|
||||
$DeserializedFile = Read-IcingaPowerShellModuleFile -FileContent $ModuleContent;
|
||||
[array]$JeaCmds = $DeserializedFile.CommandList + $DeserializedFile.FunctionList;
|
||||
|
|
|
|||
|
|
@ -7,10 +7,15 @@ function Write-IcingaPluginResult()
|
|||
|
||||
[string]$CheckResult = $PluginOutput;
|
||||
|
||||
if ($PluginPerfData -ne 0) {
|
||||
$CheckResult += "`n`r| ";
|
||||
if ($PluginPerfData.Count -ne 0) {
|
||||
[string]$PerfDataContent = '';
|
||||
foreach ($PerfData in $PluginPerfData) {
|
||||
$CheckResult += $PerfData;
|
||||
$PerfDataContent += $PerfData;
|
||||
}
|
||||
|
||||
if ([string]::IsNullOrEmpty($PerfDataContent) -eq $FALSE) {
|
||||
$CheckResult += "`n`r| ";
|
||||
$CheckResult += $PerfDataContent;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue