Skip to content

Commit ba5517e

Browse files
authored
Merge pull request #434 from Icinga:fix/exception_inside_ise_session
Fix: Exception and freezes inside PowerShell ISE session Fixes Icinga for Windows exception while running \`icinga\` commands or the Icinga Mangement Console inside an \`PowerShell ISE\` session, which behaves differently. Instead, we now load Icinga for Windows and inform the user about limitations properly.
2 parents b81a757 + 43fd685 commit ba5517e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

doc/100-General/10-Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
1313

1414
### Bugfixes
1515

16+
* [#273](https://github.com/Icinga/icinga-powershell-framework/issues/273) Fixes exceptions and freezes while using Icinga for Windows within an PowerShell ISE session and informing the user properly about the limitations
1617
* [#291](https://github.com/Icinga/icinga-powershell-framework/issues/291) Fixes `Split-IcingaVersion` by returning data with naming `mayor` for the version instead of `major`. We will return both results to give developers time to adjust their code before removing the `mayor` object
1718
* [#379](https://github.com/Icinga/icinga-powershell-framework/issues/379) Fixes memory leak for Icinga for Windows by using a custom function being more aggressive on memory cleanup
1819
* [#394](https://github.com/Icinga/icinga-powershell-framework/issues/394) Fixes lookup time for Icinga managed user for large Active Directory environments by limiting lookup to local system only

icinga-powershell-framework.psm1

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,17 @@ function Invoke-IcingaCommand()
242242
Write-IcingaFrameworkCodeCache;
243243
}
244244

245+
if ($Manage -And $null -ne $psISE) {
246+
Use-Icinga;
247+
Write-IcingaConsoleError -Message 'Icinga for Windows was loaded, but the Icinga Management Console is not available within the PowerShell ISE context. Please start a regular PowerShell to use it.';
248+
return;
249+
}
250+
251+
if ($null -ne $psISE) {
252+
Write-IcingaConsoleWarning -Message 'Icinga for Windows was successfully loaded, but the current PowerShell ISE environment is not fully supported. For advanced and production tasks, please use Icinga for Windows inside a regular PowerShell environment.';
253+
return;
254+
}
255+
245256
powershell.exe -NoExit -Command {
246257
$Script = $args[0];
247258
$RootPath = $args[1];

0 commit comments

Comments
 (0)