Refactor switch statements

This commit is contained in:
Manuel Thalmann 2024-03-23 21:51:19 +01:00
parent 67fc0770f3
commit 04e8ae1197
2 changed files with 2 additions and 2 deletions

View file

@ -29,7 +29,7 @@ function Start-WindowsInstallation([Context] $context) {
while (-not $finished) {
switch ($context.GetStage()) {
{ $_ -in $null,$initialConfigStage } {
{ (-not $_) -or ($_ -eq $initialConfigStage) } {
$context.SetStage($initialConfigStage);
if ((Get-Command Initialize-Configuration -ErrorAction SilentlyContinue)) {

View file

@ -25,7 +25,7 @@ function New-PersonalUser([Context] $context, [string] $userName)
}
switch (Get-UserStage) {
{ $_ -in $null,$creationStage } {
{ (-not $_) -or ($_ -eq $creationStage) } {
Set-UserStage $creationStage;
if (-not (Get-LocalUser $userName -ErrorAction SilentlyContinue)) {