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.
If you have multiple copies of PSCore6 on your system, they all write to the same
ModuleAnalysisCachefile. 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 ownModuleAnalysisCache. Perhaps add a hash of the path topwshto the cache filename.