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 callmain
parent
532425e2a0
commit
a5d737eaee
|
|
@ -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." }
|
||||
|
|
|
|||
Loading…
Reference in New Issue