puppetlabs / ruby-pwsh

A ruby gem for interacting with PowerShell
MIT License
15 stars 21 forks source link

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

Closed jordanbreen28 closed 8 months ago

jordanbreen28 commented 8 months ago

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.

Related Issues (if any)

Fixes https://github.com/puppetlabs/ruby-pwsh/issues/262

Checklist