diff --git a/doc/100-General/10-Changelog.md b/doc/100-General/10-Changelog.md index 21141de..7fff1b1 100644 --- a/doc/100-General/10-Changelog.md +++ b/doc/100-General/10-Changelog.md @@ -34,6 +34,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic * [#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 +* [#452](https://github.com/Icinga/icinga-powershell-framework/pull/452) Fixes unhandled `true` output on the console while running the installer ### Enhancements diff --git a/lib/core/icingaagent/installer/Repair-IcingaService.psm1 b/lib/core/icingaagent/installer/Repair-IcingaService.psm1 index 9851bb9..885e41b 100644 --- a/lib/core/icingaagent/installer/Repair-IcingaService.psm1 +++ b/lib/core/icingaagent/installer/Repair-IcingaService.psm1 @@ -78,7 +78,7 @@ function Repair-IcingaService() $ServiceUser = $ConfigUser; } - Set-IcingaServiceUser -User $ServiceUser -SetPermission; + Set-IcingaServiceUser -User $ServiceUser -SetPermission | Out-Null; Update-IcingaServiceUser; Write-IcingaConsoleNotice -Message 'Icinga Agent service was successfully repaired. You can start it now with "Start-Service icinga2"'; diff --git a/lib/core/icingaagent/setters/Set-IcingaAgentServiceUser.psm1 b/lib/core/icingaagent/setters/Set-IcingaAgentServiceUser.psm1 index d104e4b..04229e9 100644 --- a/lib/core/icingaagent/setters/Set-IcingaAgentServiceUser.psm1 +++ b/lib/core/icingaagent/setters/Set-IcingaAgentServiceUser.psm1 @@ -8,12 +8,12 @@ function Set-IcingaServiceUser() ); if ([string]::IsNullOrEmpty($User)) { - throw 'Please specify a username to modify the service user'; + Write-IcingaConsoleError -Message 'Please specify a username to modify the service user'; return $FALSE; } if ($null -eq (Get-Service $Service -ErrorAction SilentlyContinue)) { - return; + return $FALSE; } if ($User.Contains('\') -eq $FALSE) { diff --git a/lib/core/repository/Install-IcingaComponent.psm1 b/lib/core/repository/Install-IcingaComponent.psm1 index bb161b2..b8b181b 100644 --- a/lib/core/repository/Install-IcingaComponent.psm1 +++ b/lib/core/repository/Install-IcingaComponent.psm1 @@ -176,7 +176,7 @@ function Install-IcingaComponent() [void](Remove-ItemSecure -Path $entry.FullName -Recurse -Force); } - [void](Copy-ItemSecure -Path $PackageRoot -Destination $ComponentFolder -Recurse -Force); + Copy-ItemSecure -Path $PackageRoot -Destination $ComponentFolder -Recurse -Force | Out-Null; Write-IcingaConsoleNotice 'Installing version "{0}" of component "{1}"' -Objects $ManifestFile.ModuleVersion, $Name.ToLower(); @@ -269,7 +269,7 @@ function Install-IcingaComponent() Write-IcingaConsoleNotice 'Installing component "service" into "{0}"' -Objects $ServiceDirectory; - Copy-ItemSecure -Path $binary.FullName -Destination $UpdateBin -Force; + Copy-ItemSecure -Path $binary.FullName -Destination $UpdateBin -Force | Out-Null; [void](Install-IcingaForWindowsService -Path $ServiceBin -User $ServiceUser -Password (Get-IcingaInternalPowerShellServicePassword)); Update-IcingaServiceUser; @@ -373,7 +373,7 @@ function Install-IcingaComponent() return $FALSE; } - Set-IcingaServiceUser -User $ServiceUser -SetPermission; + Set-IcingaServiceUser -User $ServiceUser -SetPermission | Out-Null; Update-IcingaServiceUser; Write-IcingaConsoleNotice 'Installation of component "agent" with version "{0}" was successful.' -Objects $MSIData.ProductVersion;