From 141ef828ad1ba4b4bba622c1a6195b79de11e35a Mon Sep 17 00:00:00 2001 From: Martin Wiethan <47688561+Marterich@users.noreply.github.com> Date: Wed, 10 Jul 2024 13:39:50 +0200 Subject: [PATCH] Fixed Extraction of JSON Object Names --- Compile.ps1 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Compile.ps1 b/Compile.ps1 index a8bf570d..a18e1958 100644 --- a/Compile.ps1 +++ b/Compile.ps1 @@ -58,10 +58,8 @@ Get-ChildItem .\config | Where-Object {$psitem.extension -eq ".json"} | ForEach- # Only do so if json files has content to be displayed (for example the applications, tweaks, features json files) # Some Type Convertion using Casting and Cleaning Up of the convertion result using 'Replace' Method $jsonAsObject = $json | convertfrom-json - $firstLevelJsonList = ([System.String]$jsonAsObject).split('=;') | ForEach-Object { - $_.Replace('=}','').Replace('@{','').Replace(' ','') - } - + $firstLevelJsonList = [System.Collections.ArrayList]::new() + $jsonAsObject.PSObject.Properties.Name | ForEach-Object {$null = $firstLevelJsonList.Add($_)} # Note: # Avoid using HTML Entity Codes, for example '”' (stands for "Right Double Quotation Mark"), # Use **HTML decimal/hex codes instead**, as using HTML Entity Codes will result in XML parse Error when running the compiled script.