Suppress unnecessary output
This commit is contained in:
parent
30e7c163f2
commit
aa14dd7beb
1 changed files with 15 additions and 9 deletions
|
@ -196,9 +196,9 @@ $null = New-Module {
|
|||
function Start-SoftwareInstaller {
|
||||
param(
|
||||
[string] $Name,
|
||||
[scriptblock] $Installer = { },
|
||||
[scriptblock] $Configurator = { },
|
||||
[scriptblock] $UserConfigurator = { },
|
||||
[scriptblock] $Installer = $null,
|
||||
[scriptblock] $Configurator = $null,
|
||||
[scriptblock] $UserConfigurator = $null,
|
||||
[Nullable[InstallerAction]] $Action,
|
||||
[hashtable] $Arguments
|
||||
)
|
||||
|
@ -236,12 +236,16 @@ $null = New-Module {
|
|||
};
|
||||
|
||||
if ($action -eq ([InstallerAction]::Install)) {
|
||||
if ($Installer) {
|
||||
Write-Host "Installing $Name…";
|
||||
& $Installer @argumentList;
|
||||
}
|
||||
# ToDo: Automatically configure after installation
|
||||
} elseif ($Action -eq ([InstallerAction]::Configure)) {
|
||||
if ($Configurator) {
|
||||
Write-Host "Configuring $Name…";
|
||||
& $Configurator @argumentList;
|
||||
}
|
||||
|
||||
if (-not (Test-SetupUser)) {
|
||||
$argumentList.Add("action", [InstallerAction]::ConfigureUser);
|
||||
|
@ -252,9 +256,11 @@ $null = New-Module {
|
|||
$argumentList.Add($userArgument, ($env:UserName));
|
||||
}
|
||||
|
||||
if ($UserConfigurator) {
|
||||
Write-Host "Configuring $Name for user ``$($Arguments[$userArgument])``…";
|
||||
& $UserConfigurator @argumentList;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
& $installHandler -Action $Action -Arguments $Arguments;
|
||||
|
|
Loading…
Reference in a new issue