fix(kiosk): WESL DefaultAction is sint32 not uint32 (2nd e2e finding) #8

Merged
SilverLABS merged 1 commits from fix/kiosk-defaultaction-type into main 2026-06-09 15:46:29 +00:00

View File

@@ -45,10 +45,10 @@ $sid=(New-Object System.Security.Principal.NTAccount($BootstrapUser)).Translate(
try { try {
Invoke-CimMethod -Namespace $cls -ClassName WESL_UserSetting -MethodName SetEnabled -Arguments @{Enabled=$true} | Out-Null Invoke-CimMethod -Namespace $cls -ClassName WESL_UserSetting -MethodName SetEnabled -Arguments @{Enabled=$true} | Out-Null
# Default shell = Explorer for everyone else (incl. OOBE) — critical so non-kiosk logons don't break. # Default shell = Explorer for everyone else (incl. OOBE) — critical so non-kiosk logons don't break.
Invoke-CimMethod -Namespace $cls -ClassName WESL_UserSetting -MethodName SetDefaultShell -Arguments @{Shell='explorer.exe';DefaultAction=[uint32]0} | Out-Null Invoke-CimMethod -Namespace $cls -ClassName WESL_UserSetting -MethodName SetDefaultShell -Arguments @{Shell='explorer.exe';DefaultAction=[int32]0} | Out-Null
# sm-bootstrap => the elevating launcher; on exit, restart the shell (action 0). # sm-bootstrap => the elevating launcher; on exit, restart the shell (action 0).
Invoke-CimMethod -Namespace $cls -ClassName WESL_UserSetting -MethodName SetCustomShell -Arguments @{ Invoke-CimMethod -Namespace $cls -ClassName WESL_UserSetting -MethodName SetCustomShell -Arguments @{
Sid=$sid; Shell="cmd.exe /c `"$launcher`""; DefaultAction=[uint32]0 } | Out-Null Sid=$sid; Shell="cmd.exe /c `"$launcher`""; DefaultAction=[int32]0 } | Out-Null
$set=Invoke-CimMethod -Namespace $cls -ClassName WESL_UserSetting -MethodName GetCustomShell -Arguments @{Sid=$sid} -ErrorAction SilentlyContinue $set=Invoke-CimMethod -Namespace $cls -ClassName WESL_UserSetting -MethodName GetCustomShell -Arguments @{Sid=$sid} -ErrorAction SilentlyContinue
if (-not $set -or [string]::IsNullOrEmpty($set.Shell)) { throw "custom shell did not take for $BootstrapUser" } if (-not $set -or [string]::IsNullOrEmpty($set.Shell)) { throw "custom shell did not take for $BootstrapUser" }
Log "shell launcher configured for sm-bootstrap (shell=$($set.Shell))" Log "shell launcher configured for sm-bootstrap (shell=$($set.Shell))"