Skip to content

Commit f714ed9

Browse files
fix: nested array handling for bicep (#426)
# Pull Request ## Issue Issue #, if available: #425 ## Description Description of changes: Fix handling of nested arrays when setting Bicep config ## License By submitting this pull request, I confirm that my contribution is made under the terms of the projects associated license.
1 parent 5942e5b commit f714ed9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,12 @@ function Set-Config {
5454
Write-Verbose "Input config item value type pre-standardization: $inputConfigItemValueType"
5555

5656
# Convert to standard type
57-
$inputConfigItemValue = $inputConfigItemValue | ConvertTo-Json | ConvertFrom-Json
57+
$inputConfigItemValueJson = ConvertTo-Json -InputObject $inputConfigItemValue -Depth 100
58+
Write-Verbose "Input config item value pre-standardization: $inputConfigItemValueJson"
59+
$inputConfigItemValue = ConvertFrom-Json -InputObject $inputConfigItemValueJson -Depth 100 -NoEnumerate
5860
$inputConfigItemValueType = $inputConfigItemValue.GetType().FullName
5961
Write-Verbose "Input config item value type post-standardization: $inputConfigItemValueType"
62+
Write-Verbose "Input config item value post-standardization: $(ConvertTo-Json $inputConfigItemValue -Depth 100)"
6063

6164
$indexString = $indexSplit[1].Replace("`"", "").Replace("'", "")
6265
Write-Verbose "Using index $indexString for input config item $inputConfigName"

0 commit comments

Comments
 (0)