Skip to content

Commit b878e56

Browse files
committed
bug: handle single item array
1 parent dffa2d8 commit b878e56

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ALZ/Private/Config-Helpers/Set-Config.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ function Set-Config {
6565
# Handle integer index for arrays
6666
Write-Verbose "Handling integer index for array"
6767

68+
# Ensure single value array is treated as array
69+
if(!$inputConfigItemValueType.EndsWith("]")) {
70+
Write-Verbose "Converting single value to array for input config item $($inputConfigName)."
71+
$inputConfigItemValue = @($inputConfigItemValue)
72+
}
73+
6874
$index = [int]$indexString
6975
if($inputConfigItemValue.Length -le $index) {
7076
Write-Verbose "Input config item $($inputConfigName) does not have an index of $index."

0 commit comments

Comments
 (0)