DSC: (at runtime): Could not find the type of DSC resource class {resourceName}

Here’s another good one. The DSC configuration compiles without error, however, when running the resource and the resource has to change something (i.e. calling [void] Set(), I get the lovely error:

I don’t know why it is the case, but the solution for me is to change FunctionToExport in the resource’s .psd1 file.

Change from: FuntionsToExport = @('Get-Something','Start-Something','Write-MyBio') To: FunctionsToExport = '*'

In my mind, this is not how it should be, not best practice, but until someone can explain why, I’ll have to live with it.

Update 1

This isn’t the problem. It just appeared to be resolved, but when I ran Import-Module myClassBasedResource -Force -Verbose the problem manifested itself again. It is to do with this: http://blog.thingsgeeky.co.uk/?p=10454. Still searching for a solution. At this point in time, I’ve had to move the DSCClassResources out of the parent resource.

Please feel free to leave a comment...