Merge pull request #375 from Icinga:fix/exception_on_last_uninstall_message

Fix: Exception on last uninstall message print

Fixes an exception on the last message output while running `Uninstall-IcingaForWindows`, as the used function is no longer available due to Framework uninstallation.

We now replaced the last messages with proper `Write-Host` output
This commit is contained in:
Lord Hepipud 2021-09-15 13:41:49 +02:00 committed by GitHub
commit f99230eb0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View file

@ -7,6 +7,14 @@ documentation before upgrading to a new release.
Released closed milestones can be found on [GitHub](https://github.com/Icinga/icinga-powershell-framework/milestones?state=closed). Released closed milestones can be found on [GitHub](https://github.com/Icinga/icinga-powershell-framework/milestones?state=closed).
## 1.7.0 (2021-11-09)
[Issue and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/16?closed=1)
### Bugfixes
* [#375](https://github.com/Icinga/icinga-powershell-framework/pull/375) Fixes exception on last message printed during `Uninstall-IcingaForWindows`, because the prior used function is no longer present at this point
## 1.6.1 (2021-09-15) ## 1.6.1 (2021-09-15)
[Issue and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/21?closed=1) [Issue and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/21?closed=1)

View file

@ -71,8 +71,8 @@ function Uninstall-IcingaForWindows()
Remove-Module 'icinga-powershell-framework' -Force -ErrorAction SilentlyContinue; Remove-Module 'icinga-powershell-framework' -Force -ErrorAction SilentlyContinue;
if ($HasErrors) { if ($HasErrors) {
Write-IcingaConsoleWarning 'Not all components could be removed. Please ensure no other PowerShell/Application is currently open and accessing Icinga for Windows files'; Write-Host 'Not all components could be removed. Please ensure no other PowerShell/Application is currently open and accessing Icinga for Windows files';
} else { } else {
Write-IcingaConsoleNotice 'Icinga for Windows was removed from this host.'; Write-Host 'Icinga for Windows was removed from this host.';
} }
} }