Open Hvid opened 1 year ago
Correction, it's in SqlServerDsc.psm1. Maybe that file is just not imported?
Seems this thing broke it: https://github.com/dsccommunity/SqlServerDsc/pull/1826
Hey @Hvid, in this case the only own the wrapper. We currently use Puppet.Dsc to wrap the code on the PowerShell Gallery therefore we have no control over the actual code that we wrap. My suggestion would be to downgrade the module to v16.0.0-0-0 until this is fixed in the Powershell Gallery. When it is fixed in the Powershell Gallery if you request us to republish the module containing the fix from the Powershell Gallery we will have no issues doing this.
Okay, but this works in powershell, without puppet. Is there any info i can pass on to the owners of the module to make it compatible?
I'm having exactly the same issue, with dsc-sqlserverdsc v 16.4.0-0-4 and Puppet 8
So the break-fix for this was to put C:\ProgramData\PuppetLabs\puppet\cache\lib\puppet_x\sqlserverdsc\dsc_resources into the PsmodulesPath environment variable.
I am not sure if this project is setup to include that particular path or not.
transferring as fix will go into ruby-pwsh.
Released in v1.0.1 of puppetlabs-pwshlib.
Running puppet module upgrade puppetlabs-pwshlib
will allow you to consume the change.
Thanks everyone!
I don't think the fix is working. I believe I am still getting the error:
dsc_sqllogin: PowerShell DSC resource DSC_SqlLogin failed to execute Get-TargetResource functionality with error message: Failed to find a dependent module.
The above breakfix seems to still be required for it to function
I agree @rismoney I get the same error
Thanks for the update @rismoney and @ic248 - I'll re-open the issue! This is open-source so happy to accept and collaborate on PRs in the meantime if anyone thinks of a nice way to manipulate the load PSModulePath in ruby-pwsh! Hope to get a proper look at this again shortly.
I updated to v16.4.0-0-0 from v16.0.0-0-0 and now i get these errors: Error: dsc_sqlmemory: The term 'Import-SqlDscPreferredModule' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. Error: dsc_sqlmemory: The term 'Import-SqlDscPreferredModule' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. Error: /Stage[main]/Sqlhosting::Server/Dsc_sqlmemory[max_memory]: Could not evaluate: undefined method `[]' for nil:NilClass
Seems that function is not included in the module.