Skip to content
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

(CAT-1617) - Always load vendored module in PSModulePath #261

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

jordanbreen28
Copy link
Contributor

@jordanbreen28 jordanbreen28 commented Dec 12, 2023

Summary

Prior to this PR, the vendored dsc module would only be loading into the PSModulePath Env variable if the dsc resource type was implemented as a Class.

Now that DSC Modules seem to be taking the approach of abstracting the DscResource.Base into a seperate module which is then imported, we need to alter the PSModulePath Env variable to include the vendored modules path to ensure this module and its classes (Resource Base) are imported as expected.

Its worth noting that ruby-pwsh will only temporarily add the vendored module path to the PSModulePath Env variable during the puppet agent run, before removing it again in the Dsc resource post invocation script.

Additional Context

Add any additional context about the problem here.

  • Root cause and the steps to reproduce. (If applicable)
  • Thought process behind the implementation.

Related Issues (if any)

Fixes #262

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified.

Prior to this commit, the vendored dsc module would only be loading into
the PSModulePath Env variable if the dsc resource type was implemented
as a Class.

Now that DSC Modules seem to be taking the approach of abstracting the
DscResource.Base module into a seperate module which is then imported,
we need to alter the PSModulePath Env variable to include the vendored
modules path to ensure these modules are imported as expected.
@jordanbreen28 jordanbreen28 marked this pull request as ready for review December 12, 2023 15:36
@jordanbreen28 jordanbreen28 requested a review from a team as a code owner December 12, 2023 15:36
Copy link
Contributor

@gavindidrichsen gavindidrichsen left a comment

Choose a reason for hiding this comment

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

Nice Work!!

@gavindidrichsen gavindidrichsen merged commit 44d1770 into main Dec 12, 2023
6 checks passed
@gavindidrichsen gavindidrichsen deleted the cat-1617-fix_psmodule_load_path branch December 12, 2023 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dsc-sqlserverdsc v 16.4.0-0-0 error
2 participants