Fix handling of setup stages

This commit is contained in:
Manuel Thalmann 2024-07-31 22:33:37 +02:00
parent 2a7adfeba3
commit d7cc1a53bf

View file

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