Skip to content

Allow extending PSModulePath in settings.json #2356

@chriskuech

Description

@chriskuech

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 the PSModulePath environment variable prior to loading intellisense.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions