From b878e567461a6eb0c59404a5e7d63cb10e20dc94 Mon Sep 17 00:00:00 2001 From: Jared Holgate Date: Mon, 22 Sep 2025 08:50:18 +0100 Subject: [PATCH] bug: handle single item array --- src/ALZ/Private/Config-Helpers/Set-Config.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ALZ/Private/Config-Helpers/Set-Config.ps1 b/src/ALZ/Private/Config-Helpers/Set-Config.ps1 index a2eb311..f913451 100644 --- a/src/ALZ/Private/Config-Helpers/Set-Config.ps1 +++ b/src/ALZ/Private/Config-Helpers/Set-Config.ps1 @@ -65,6 +65,12 @@ function Set-Config { # Handle integer index for arrays Write-Verbose "Handling integer index for array" + # Ensure single value array is treated as array + if(!$inputConfigItemValueType.EndsWith("]")) { + Write-Verbose "Converting single value to array for input config item $($inputConfigName)." + $inputConfigItemValue = @($inputConfigItemValue) + } + $index = [int]$indexString if($inputConfigItemValue.Length -le $index) { Write-Verbose "Input config item $($inputConfigName) does not have an index of $index."