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

Fix errors with Invoke and class-based resources #99

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nyanhp
Copy link

@nyanhp nyanhp commented Jan 18, 2023

PR Summary

Fixes #73

PR Context

I recently ran into the very old issue #73, got very annoyed by it and decided to implement the solution that was already suggested two years ago. A quick test on Windows and Ubuntu looked promising.

@@ -4627,7 +4627,7 @@ function Invoke-DscClassBasedResource
Write-Debug "Importing $path ..."
$powershell = [PowerShell]::Create('CurrentRunspace')
$script = @"
using module $path
using module '$path'
Copy link
Member

@SteveL-MSFT SteveL-MSFT Mar 27, 2023

Choose a reason for hiding this comment

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

Suggested change
using module '$path'
using module "$path"

Needs to be double quote otherwise the contents becomes a literal and the variable won't be expanded

Copy link
Author

Choose a reason for hiding this comment

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

It's a here-string, this does not make a difference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants