Propagate te.exe exit code from run-tests.ps1 (#40497)

`te.exe` is invoked as a native command, so its failure should be detected via `0` rather than `!True` (which can be unreliable for native processes under `Set-StrictMode`). Also propagate the actual exit code instead of substituting a hardcoded `1` so callers (CI, wrapper scripts) can distinguish between te.exe failure modes. Also fix the `-Package` parameter doc: the actual default is `.\installer.msix`, not `.\wsl.msix`. Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Ben Hillis committed May 11, 2026 at 12:46 UTC e7f5202b5dc37c11f14d014d99796cd93c7379ef
1 file changed +3 -3
tools/test/run-tests.ps1
+3 -3
@@ -12,7 +12,7 @@
12 .PARAMETER TestDataPath
13 Path to test data folder. Defaults to ".\test_data".
14 .PARAMETER Package
15 - Path to the wsl.msix package to install. Defaults to ".\wsl.msix".
15 + Path to the wsl.msix package to install. Defaults to ".\installer.msix".
16 .PARAMETER UnitTestsPath
17 Path to the linux/unit_tests directory to copy and install the unit tests.
18 .PARAMETER PullRequest
@@ -103,9 +103,9 @@ if ($AttachDebugger)
103 else
104 {
105 te.exe $teArgList
106 - if (!$?)
106 + if ($LASTEXITCODE -ne 0)
107 {
108 - exit 1
108 + exit $LASTEXITCODE
109 }
110 }
111