From 690a3970d054887cfce3a8c69133216e17027318 Mon Sep 17 00:00:00 2001 From: Reditus <33814724+ReditusDraco@users.noreply.github.com> Date: Tue, 19 May 2026 07:08:54 +0100 Subject: [PATCH] Fix debug mode enable - recursively convert PS objects to hashtables --- launcher.ps1 | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/launcher.ps1 b/launcher.ps1 index c25e1c8..f34acf1 100644 --- a/launcher.ps1 +++ b/launcher.ps1 @@ -2205,9 +2205,23 @@ print(json.dumps(s)) } $settings = $settingsJson | ConvertFrom-Json - # Enable debug logging - convert to hashtable for reliable modification - $settingsHash = @{} - $settings.PSObject.Properties | ForEach-Object { $settingsHash[$_.Name] = $_.Value } + # Enable debug logging - convert entire object to nested hashtables + function ConvertTo-HashTable($obj) { + $hash = @{} + if ($obj -eq $null) { return $hash } + $obj.PSObject.Properties | ForEach-Object { + if ($_.Value -is [System.Management.Automation.PSCustomObject]) { + $hash[$_.Name] = ConvertTo-HashTable $_.Value + } elseif ($_.Value -is [System.Array]) { + $hash[$_.Name] = @($_.Value) + } else { + $hash[$_.Name] = $_.Value + } + } + return $hash + } + + $settingsHash = ConvertTo-HashTable $settings if (-not $settingsHash.logging) { $settingsHash.logging = @{}