Allow extending PSModulePath in settings.json #2356
Labels
Area-Workspaces
Issue-Enhancement
A feature request (enhancement).
Resolution-Duplicate
Will close automatically.
Summary of the new feature
Right now, PowerShell has very limited capabilities for IntelliSense due to how dynamic the language is and some specific bugs with its implementation. The only pattern that seems to work is to create a custom modules folder in the workspace, update PSModulePath to include the custom modules folder, then reference the modules in code by name (instead of path). This works around the language limitations, but requires running initialization scripts in the session or modifying global environment variables to work. Users should be able to update PSModulePath in their vscode settings.json so they can define classes/functions that are discovered by IntelliSense without confusing manual tasks (initializing VS Code's session) or modifying their global environment for a single workspace (setting environment variables).
Proposed technical implementation details (optional)
Add a field
"powershell.psModulePath"
to settings.json that takes an array of string paths and prepends them to thePSModulePath
environment variable prior to loading intellisense.The text was updated successfully, but these errors were encountered: