-
Notifications
You must be signed in to change notification settings - Fork 0
fix: windows script #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,7 +50,7 @@ for ($i = 1; $i -le $maxAttempts; $i++) { | |
| } | ||
|
|
||
| try { | ||
| & $ScriptDest @args | ||
| powershell.exe -ExecutionPolicy Bypass -File $ScriptDest @args | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Child process exit code not propagated to parentHigh Severity Switching from |
||
| } finally { | ||
| Remove-Item $TmpDir -Recurse -Force -ErrorAction SilentlyContinue | ||
| } | ||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WSL set-default-version success check ignores command exit code
Medium Severity
The old code verified
wsl --set-default-version 2succeeded by checking$LASTEXITCODE -eq 0. The new code only checks whether the background job completed within the timeout viaWait-Job, butWait-Jobreturns the job object regardless of whether the command inside exited with a non-zero code — the job state is "Completed" either way. So if the WSL command fails, the script still logs "WSL2 set as default." and the user never sees the warning or the hint to run it manually.