-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Description
From PowerShell/vscode-powershell#2008.
Related to #6850.
When using a RunspacePool (common in hosted and remote contexts), the PSModulePath gets reset whenever a runspace is opened.
This occurs because ModuleIntrinsics sets the module path at constructor time:
PowerShell/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs
Lines 41 to 47 in 66c628f
| internal ModuleIntrinsics(ExecutionContext context) | |
| { | |
| _context = context; | |
| // And initialize the module path... | |
| SetModulePath(); | |
| } |
as if it were a process-singleton.
Every time a runspace is opened in PowerShell, the whole process gets its PSModulePath reset, which is a problem for things like EditorServices where we use a runspace to run analysis in the background, but users expect to be able to modify the PSModulePath in the IntegratedConsole.
SeeminglyScience, vexx32, kborowinski and alx9r
Metadata
Metadata
Assignees
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime