Skip to content

Each install of pwsh should have it's own ModuleAnalysisCache #8172

@SteveL-MSFT

Description

@SteveL-MSFT

If you have multiple copies of PSCore6 on your system, they all write to the same ModuleAnalysisCache file. This can potentially produce unexpected results. Modules in this cache are stored with absolute path, so if pwsh1 is in path $PSHOME1, then it will cache modules under $PSHOME1\Modules. When you then run pwsh2 in $PSHOME2, it can still find modules in $PSHOME1\Modules since it's in the cache. It seems that each "install" of PSCore6 should write to its own ModuleAnalysisCache. Perhaps add a hash of the path to pwsh to the cache filename.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtime

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions