Merge pull request #452 from Icinga:fix/unhandled_true_in_output_during_installation

Fix: Unhandled true output during installation

Fixes unhandled `true` output on the console while running the installer
This commit is contained in:
Lord Hepipud 2022-01-28 09:03:07 +01:00 committed by GitHub
commit e3e330f5d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 6 deletions

View file

@ -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

View file

@ -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"';

View file

@ -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) {

View file

@ -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;