Skip to content

Commit e2903f9

Browse files
committed
fix(endpoint): preserve app template keys
Parse app template config JSON with `-AsHashtable` before converting it back to a PSCustomObject so templates can carry both `applicationName` and `ApplicationName` without losing data. This avoids deployment issues caused by PowerShell's default case-insensitive JSON object handling.
1 parent 8e421bf commit e2903f9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Modules/CIPPHTTP/Public/Entrypoints/HTTP Functions/Endpoint/Applications/Invoke-ExecDeployAppTemplate.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@ function Invoke-ExecDeployAppTemplate {
5151
try {
5252
$Config = $App.config
5353
if ($Config -is [string]) {
54-
$Config = $Config | ConvertFrom-Json -Depth 100
54+
# Parse case-sensitive to survive templates carrying both 'applicationName'
55+
# and 'ApplicationName', then collapse them via a case-insensitive dictionary.
56+
$Parsed = $Config | ConvertFrom-Json -Depth 100 -AsHashtable
57+
$Config = [ordered]@{}
58+
foreach ($Key in $Parsed.Keys) { $Config[$Key] = $Parsed[$Key] }
59+
$Config = [PSCustomObject]$Config
5560
}
5661

5762
$AppType = "$($App.appType ?? $App.AppType)"

0 commit comments

Comments
 (0)