Skip to content

Commit e3e330f

Browse files
authored
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
2 parents f4e58c2 + c82ab62 commit e3e330f

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

doc/100-General/10-Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
3434
* [#446](https://github.com/Icinga/icinga-powershell-framework/pull/446) Fixes Icinga for Windows progress preference, which sometimes caused UI glitches
3535
* [#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
3636
* [#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
37+
* [#452](https://github.com/Icinga/icinga-powershell-framework/pull/452) Fixes unhandled `true` output on the console while running the installer
3738

3839
### Enhancements
3940

lib/core/icingaagent/installer/Repair-IcingaService.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function Repair-IcingaService()
7878
$ServiceUser = $ConfigUser;
7979
}
8080

81-
Set-IcingaServiceUser -User $ServiceUser -SetPermission;
81+
Set-IcingaServiceUser -User $ServiceUser -SetPermission | Out-Null;
8282
Update-IcingaServiceUser;
8383

8484
Write-IcingaConsoleNotice -Message 'Icinga Agent service was successfully repaired. You can start it now with "Start-Service icinga2"';

lib/core/icingaagent/setters/Set-IcingaAgentServiceUser.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ function Set-IcingaServiceUser()
88
);
99

1010
if ([string]::IsNullOrEmpty($User)) {
11-
throw 'Please specify a username to modify the service user';
11+
Write-IcingaConsoleError -Message 'Please specify a username to modify the service user';
1212
return $FALSE;
1313
}
1414

1515
if ($null -eq (Get-Service $Service -ErrorAction SilentlyContinue)) {
16-
return;
16+
return $FALSE;
1717
}
1818

1919
if ($User.Contains('\') -eq $FALSE) {

lib/core/repository/Install-IcingaComponent.psm1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ function Install-IcingaComponent()
176176
[void](Remove-ItemSecure -Path $entry.FullName -Recurse -Force);
177177
}
178178

179-
[void](Copy-ItemSecure -Path $PackageRoot -Destination $ComponentFolder -Recurse -Force);
179+
Copy-ItemSecure -Path $PackageRoot -Destination $ComponentFolder -Recurse -Force | Out-Null;
180180

181181
Write-IcingaConsoleNotice 'Installing version "{0}" of component "{1}"' -Objects $ManifestFile.ModuleVersion, $Name.ToLower();
182182

@@ -269,7 +269,7 @@ function Install-IcingaComponent()
269269

270270
Write-IcingaConsoleNotice 'Installing component "service" into "{0}"' -Objects $ServiceDirectory;
271271

272-
Copy-ItemSecure -Path $binary.FullName -Destination $UpdateBin -Force;
272+
Copy-ItemSecure -Path $binary.FullName -Destination $UpdateBin -Force | Out-Null;
273273

274274
[void](Install-IcingaForWindowsService -Path $ServiceBin -User $ServiceUser -Password (Get-IcingaInternalPowerShellServicePassword));
275275
Update-IcingaServiceUser;
@@ -373,7 +373,7 @@ function Install-IcingaComponent()
373373
return $FALSE;
374374
}
375375

376-
Set-IcingaServiceUser -User $ServiceUser -SetPermission;
376+
Set-IcingaServiceUser -User $ServiceUser -SetPermission | Out-Null;
377377
Update-IcingaServiceUser;
378378

379379
Write-IcingaConsoleNotice 'Installation of component "agent" with version "{0}" was successful.' -Objects $MSIData.ProductVersion;

0 commit comments

Comments
 (0)