From a5d737eaee48461d9410ead9c1128cc629a84070 Mon Sep 17 00:00:00 2001 From: ThioJoe <12518330+ThioJoe@users.noreply.github.com> Date: Thu, 16 Apr 2026 10:49:20 -0700 Subject: [PATCH] Add optional debug tracing and final pause - Add $debugTrace flag instead of uncommenting to to debug - Add a Read-Host pause at the end when debug tracing is enabled so output can be examined. - Fix consistency of reg call --- Startup Scripts/SandboxStartup.ps1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Startup Scripts/SandboxStartup.ps1 b/Startup Scripts/SandboxStartup.ps1 index aa0e7ae..607a257 100644 --- a/Startup Scripts/SandboxStartup.ps1 +++ b/Startup Scripts/SandboxStartup.ps1 @@ -5,7 +5,10 @@ param( [switch]$launchingSandbox ) -#Set-PSDebug -Trace 1 +# Set to $true to enable debug tracing of the script. +$debugTrace = $false + +if ($debugTrace) { Set-PSDebug -Trace 1 } # ------ Check that we're running in the Windows Sandbox ------ # This script is intended to be run from within the Windows Sandbox. We'll do a rudamentary check for if the current user is named "WDAGUtilityAccount" @@ -17,7 +20,7 @@ if ($env:USERNAME -ne "WDAGUtilityAccount") { } # Change context menu to old style -reg.exe add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /f /ve +reg add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /f /ve # Show file extensions reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "HideFileExt" /t REG_DWORD /d 0 /f @@ -142,3 +145,5 @@ if ($launchingSandbox) { Start-Process explorer.exe C:\Users\WDAGUtilityAccount\ # Uncomment to pause after running #Read-Host "Pause" +# If set to trace debug by uncommenting "Set-PSDebug -Trace 1" above, pause at the end so you can see the debug output +if ($debugTrace) { Read-Host "Debug trace complete, press Enter to exit." }