Nesting DSC resources in a root module

This topic contains 2 replies, has 2 voices, and was last updated by  Bob Dean 3 years, 6 months ago.

  • Author
  • #20315

    Bob Dean

    Hello! I am having a strange issue that is driving me nuts. I create a new DSC resource using the xDSCResourceDesigner, create a new module manifest, and everything is great. I can discover the DSC resource via get-dscresource. I would now like to add a second DSC resource to the same root module. After creating the second resource get-dscresource can discover one or the other custom resource. But, it's not always the first custom resource. My folder and file structure is consistent with the DSC resource kits. Am I missing something obvious here?

  • #20316

    Dave Wyatt

    DSC currently has some very aggressive caching that sometimes bites you. In the WMF 5.0 preview, they've added a "Debug Mode" to the local configuration manager which tells it to load up the resources from disk every time.

    For WMF 4.0, you can kill the wmiprvse process or reboot the machine to force this cache update (though that's not something you want to do in production if you can avoid it; you'll be killing other things that also rely on WMI.)

  • #20318

    Bob Dean

    Thanks, Dave. I did try both of those already. However, after hours of fighting with this, it seems that New-xDSCResource did not like one of the validateset statements I was using for one of my resource properties. I removed that parameter and rebuilt the resource, and everything seems to be happy now. I am not sure I can explain it but if I add it back in, it does stop working again.


You must be logged in to reply to this topic.