Prevent execution of unnecessary code
This commit is contained in:
parent
a854c46094
commit
09cac4e333
|
@ -94,6 +94,8 @@ $null = New-Module {
|
|||
Write-Host "Backing up $DisplayName…";
|
||||
& $Backup @argumentList;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
([InstallerAction]::Install) {
|
||||
if ($Installer -and $install) {
|
||||
|
@ -106,12 +108,16 @@ $null = New-Module {
|
|||
if ($UserConfigurator -and (-not (Test-SetupUser))) {
|
||||
& $installHandler @argumentList -Action ([InstallerAction]::ConfigureUser);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
([InstallerAction]::Configure) {
|
||||
if ($Configurator -and $install) {
|
||||
Write-Host "Configuring $DisplayName…";
|
||||
& $Configurator @argumentList;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default {
|
||||
if ((-not $Arguments.ContainsKey($userArgument)) -or (-not $Arguments[$userArgument])) {
|
||||
|
@ -136,6 +142,8 @@ $null = New-Module {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue