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