Prevent execution of unnecessary code

This commit is contained in:
Manuel Thalmann 2024-10-22 01:24:03 +02:00
parent a854c46094
commit 09cac4e333

View file

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