You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(GH-1153) Fix Powershell adapter PSModulePath normalization for WinPS
Prior to this change, the adapter munged the PSModulePath by
removing any path items containing the segment `\powershell\`
to ensure no PowerShell 7 modules are used for discovery when
invoked with the Windows PowerShell adapter.
This implementation was highlighted as a bug after moving and
renaming the `powershell-adapter` folder to `adapters/powershell`.
The tests showed that none of the test modules in the `Tests`
subfolder were discovered by the adapter.
The prior implementation removed not only the actual PowerShell 7
module paths, but _any_ module path with `powershell` anywhere in
the ancestor folder path. Not only does this cause the tests to
fail, but it also prevents users from discovering any modules
they might have added in custom locations like `~\dev\powershell`
or `D:\Tools\PowerShell`.
This change updates the implementation to specifically search for
and remove the default module paths for PowerShell _if_ PowerShell
is installed. It no longer uses a simple match for any path that
contains `powershell` as an ancester folder.
0 commit comments