Skip to content

Fix DSC_RESOURCE_PATH env var to also limit exe search #825

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 4 commits into from
Jun 4, 2025

Conversation

SteveL-MSFT
Copy link
Member

PR Summary

The original intent of DSC_RESOURCE_PATH was to constrain searching not only manifests but also executables to the paths of that env var. However, the current code only used it for finding resource manifests and relied on the existing PATH to find executables.

The change is to set the process PATH env var to same as DSC_RESOURCE_PATH such that the original intent is respected. We should make this clear in the docs. If the user wants to temporarily add to PATH using this env var, they should append PATH to it like:

$env:DSC_RESOURCE_PATH = "foo;$env:PATH"

PR Context

Fix #814

@SteveL-MSFT
Copy link
Member Author

Looks like a bunch of tests relied on the previous behavior and I'll need to fix them

@SteveL-MSFT SteveL-MSFT marked this pull request as draft May 21, 2025 18:39
@SteveL-MSFT SteveL-MSFT marked this pull request as ready for review June 3, 2025 21:06
@SteveL-MSFT SteveL-MSFT force-pushed the dscresourcepath-path branch from 3576c17 to ca2473d Compare June 3, 2025 21:07
@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue Jun 4, 2025
Merged via the queue into PowerShell:main with commit db17be0 Jun 4, 2025
4 checks passed
@SteveL-MSFT SteveL-MSFT deleted the dscresourcepath-path branch June 4, 2025 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DSC_RESOURCE_PATH should be prefixed to PATH
2 participants