You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows PowerShell inherits PSModulePath from PowerShell Core #2636
It is expected because subprocess always inherits environment variables of parent process. If we change the default behavior it can confuse users.
We would backup PSModulePath on startup and restore before create subprocess. Or create $env:PSModulePath_Backup and check it on PowerShell startup. The second is seems easier.
I understand why it happens, but I think our story for side-by-side Windows PS/PS Core could be dependent upon this not being obtuse if Standard 2.0 doesn't provide the level of compatibility we need. It's just non-obvious to people.
I wouldn't say the only way, but yes that's how I would naively implement it. You could also query the machine env variable in other ways.
Either way, I didn't mean to imply we should update this right now. It's just important that we revisit it as compat testing for 2.0 progresses. We have to optimize for the glide path from Windows PS to PS Core.
Activity
iSazonov commentedon Mar 9, 2017
It is expected because subprocess always inherits environment variables of parent process. If we change the default behavior it can confuse users.
We would backup
PSModulePathon startup and restore before create subprocess. Or create$env:PSModulePath_Backupand check it on PowerShell startup. The second is seems easier.SteveL-MSFT commentedon Mar 9, 2017
Agree with Ilya (@iSazonov) this is
by-designas child processes are expected to inherit environment from parent. The way to address this may be to have PSModulePath in https://github.com/PowerShell/PowerShell-RFC/blob/master/1-Draft/RFC0015-PowerShell-StartupConfig.mdjoeyaiello commentedon Apr 17, 2017
I understand why it happens, but I think our story for side-by-side Windows PS/PS Core could be dependent upon this not being obtuse if Standard 2.0 doesn't provide the level of compatibility we need. It's just non-obvious to people.
iSazonov commentedon Apr 17, 2017
Then the only way is to abandon the environment variable to both versions and use a global variable from the configuration file(s).
joeyaiello commentedon Apr 17, 2017
I wouldn't say the only way, but yes that's how I would naively implement it. You could also query the machine env variable in other ways.
Either way, I didn't mean to imply we should update this right now. It's just important that we revisit it as compat testing for 2.0 progresses. We have to optimize for the glide path from Windows PS to PS Core.
iSazonov commentedon Apr 17, 2017
Mark the Issue with Wait-NetStandard20?
Still the only ways :-)
joeyaiello commentedon Apr 17, 2017
Adding label to reassess after we analyze FullCLR/CoreCLR compat
SteveL-MSFT commentedon May 11, 2017
Perhaps we could consider having
PSModulePathdefined in StartupConfig instead of a different env var if we go down the breaking change path1 remaining item
SteveL-MSFT commentedon May 16, 2017
This should be an RFC
SteveL-MSFT commentedon Aug 15, 2017
Joey Aiello (@joeyaiello) now that we can use many Windows PowerShell modules from within PSCore6, I'm moving this out of 6.0.0-HighPriority
iSazonov commentedon Aug 29, 2018
Joey Aiello (@joeyaiello) Steve Lee (@SteveL-MSFT) Seems we resolved the Issue in 6.1.0. Can we close?