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