Skip to content

For WinPS Adapter remove PS7 paths from PSModulePath #777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 5, 2025

Conversation

SteveL-MSFT
Copy link
Member

PR Summary

The WinPS adapter is inheriting PS7 paths when dsc is run from PS7, this causes WinPS to find incompatible modules. The fix here is when WinPS adapter is used to explicitly remove PS7 paths from $env:PSModulePath.

The other change is something I noticed and I think it was copied from the PS7 adapter but WinPS adapter doesn't need to worry about non-Windows so simplified the code.

PR Context

Fix #707

Copy link
Member

@mgreenegit mgreenegit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch

Copy link
Collaborator

@theJasonHelmick theJasonHelmick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SteveL-MSFT SteveL-MSFT merged commit aaec641 into PowerShell:main May 5, 2025
4 checks passed
@SteveL-MSFT SteveL-MSFT deleted the winps-psmodulepath branch May 5, 2025 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WindowsPowerShell adapter should not discover resources unavailable in Windows PowerShell
3 participants