Commit 0190500
Skip
The `TestE2EPowerShell` build task launches the server with
`$env:PSModulePath = ''` (the vscode-powershell#3886 workaround for
inheriting `powershell.exe`'s module path). PSES's `UpdatePSModulePath()`
then appends the bundled module directory, so the runspace ends up with
`;<bundled>` — a non-empty path.
That distinction matters: Windows PowerShell only auto-injects its default
module locations (`$PSHOME\Modules`, etc.) when `PSModulePath` is empty. The
moment it's non-empty, no defaults are added, so `Get-Module -ListAvailable`
finds nothing and `powerShell/getModule` returns null for every module — not
just `Microsoft.PowerShell.Archive`. I confirmed this by probing
`powershell.exe` directly: an empty path resolves the module, while any
non-empty path (including the leading-`;` shape PSES produces) does not.
pwsh 7 isn't affected because `TestE2EPwsh` never clears the path, and real
VS Code sessions always have a populated `PSModulePath`, so the feature works
in practice.
This is a test-host artifact, not a product bug, so skip both getModule tests
on the in-box Windows PowerShell leg:
- `CanSendGetModuleRequestAsync` was failing outright (null module).
- `CanSendGetModuleRequestForMissingModuleAsync` was passing vacuously — it
asserts null, which every module now returns — so it validated nothing on
this leg. Promote it from `[Fact]` to `[SkippableFact]` and skip it too.
Both still run on Linux, macOS, and the PowerShell 7 Windows legs. This
mirrors the earlier `73293931e` skip that was reverted when we tried the
"probe Archive without skipping" approach, which the harness's emptied
`PSModulePath` makes unworkable.
Drafted by Copilot (Claude Opus 4.8).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>getModule E2E tests on in-box Windows PowerShell1 parent d84e68c commit 0190500
1 file changed
Lines changed: 12 additions & 6 deletions
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1306 | 1306 | | |
1307 | 1307 | | |
1308 | 1308 | | |
1309 | | - | |
1310 | | - | |
1311 | | - | |
1312 | | - | |
1313 | | - | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
1314 | 1317 | | |
1315 | 1318 | | |
1316 | 1319 | | |
| |||
1345 | 1348 | | |
1346 | 1349 | | |
1347 | 1350 | | |
1348 | | - | |
| 1351 | + | |
1349 | 1352 | | |
1350 | 1353 | | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
1351 | 1357 | | |
1352 | 1358 | | |
1353 | 1359 | | |
| |||
0 commit comments