From d7cc1a53bfea79f8a6f970ea7f4bc60873f1a365 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 31 Jul 2024 22:33:37 +0200 Subject: [PATCH] Fix handling of setup stages --- scripts/Windows/Scripts/SetupConfig.ps1 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/Windows/Scripts/SetupConfig.ps1 b/scripts/Windows/Scripts/SetupConfig.ps1 index e32e2640..d720961e 100644 --- a/scripts/Windows/Scripts/SetupConfig.ps1 +++ b/scripts/Windows/Scripts/SetupConfig.ps1 @@ -84,7 +84,13 @@ $null = New-Module { Gets the name of the current setup stage. #> function Get-Stage { - return [SetupStage](Get-SetupOption $stageOption); + $stage = Get-SetupOption $stageOption; + + if ($null -ne $stage) { + $stage = [SetupStage]$stage; + } + + return $stage; } <# @@ -99,7 +105,7 @@ $null = New-Module { $Name ) - if (-not ($Name -is [string])) { + if (-not (($null -eq $Name) -or ($Name -is [string]))) { $Name = ([SetupStage]$Name).ToString(); }