diff --git a/src/ci_orchestrator/winimage/assets/post-install.win.ps1.tmpl b/src/ci_orchestrator/winimage/assets/post-install.win.ps1.tmpl index dfe252e..97196f3 100644 --- a/src/ci_orchestrator/winimage/assets/post-install.win.ps1.tmpl +++ b/src/ci_orchestrator/winimage/assets/post-install.win.ps1.tmpl @@ -264,7 +264,11 @@ reg add 'HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' /v La L 'Explorer UX tweaks applied (HKCU)' # ── No desktop wallpaper (keep the WS2025 default background colour) ────── -reg add 'HKCU\Control Panel\Desktop' /v Wallpaper /t REG_SZ /d '' /f | Out-Null +# NOTE: route the empty-value reg add through cmd /c. PowerShell 5.1 STRIPS an +# empty-string argument ('') when calling a native exe, so `reg add ... /d '' /f` +# would arrive as `reg add ... /d /f` — reg then eats /f as the data, loses the +# force flag, and PROMPTS "overwrite? (Yes/No)" on stdin → the script hangs. +cmd /c 'reg add "HKCU\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "" /f' | Out-Null reg add 'HKCU\Control Panel\Desktop' /v WallpaperStyle /t REG_SZ /d 0 /f | Out-Null L 'Wallpaper removed (default background colour, HKCU)' @@ -284,7 +288,8 @@ reg add 'HKU\DefaultUser2\Software\Microsoft\Windows\CurrentVersion\Explorer\Adv reg add 'HKU\DefaultUser2\Console\%Startup' /v DelegationConsole /t REG_SZ /d '{E12CFF52-A866-4C77-9A90-F570A7AA2C6B}' /f | Out-Null reg add 'HKU\DefaultUser2\Console\%Startup' /v DelegationTerminal /t REG_SZ /d '{E12CFF52-A866-4C77-9A90-F570A7AA2C6B}' /f | Out-Null # No wallpaper (keep default background colour) for any future profile. -reg add 'HKU\DefaultUser2\Control Panel\Desktop' /v Wallpaper /t REG_SZ /d '' /f | Out-Null +# cmd /c for the empty value — see PS-5.1 empty-arg note in the HKCU block above. +cmd /c 'reg add "HKU\DefaultUser2\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "" /f' | Out-Null reg add 'HKU\DefaultUser2\Control Panel\Desktop' /v WallpaperStyle /t REG_SZ /d 0 /f | Out-Null reg unload HKU\DefaultUser2 2>&1 | Out-Null L 'Taskbar: search hidden, task view hidden, WT default terminal, no wallpaper'