Greetings, I’m currently doing my best to put the final touches on my first attempt at working with DSC Resources. At this point I feel pretty comfortable with PowerShell but as far as DSC is concerned I’d really like to get input from others as to how to proceed with the situation I’ve found myself in.
I decided to take a look at xFirefox and xChrome (both on PowerShell Gallery) as starting points for what a DSC Resource would look like. Using these as a starting point, I was able to write modules with Configuration blocks for installing other software like 7Zip, Thunderbird, and Nmap. I got to the point where the DSC Resources have the correct file structure (schema.mof files in the correct place, psd1 files where required). I’m able to take all my modules are list them via Get-DSCResource and confirm that they are the correct version and name. (I have the code available for all of these and they were previously on PowerShell Gallery before I had to unlist them to fix what I will mention below).
I got notice from PowerShell Gallery that my modules need to be improved by adding the functions Get, Test, and Set-TargetResource. After further research I now understand that these are a fundamental component of DSC Resources, and I understand that these are skeleton functions that need to be filled out for each DSC Resource.
What I am trying to understand is why the xFirefox and xChrome modules don’t have these functions in the psm1 file if it’s required for all DSC resources. I was also told that one of the errors in my module is "The DSC engine could not load the module ‘xPSDesiredStateConfiguration’. " which I thought was interesting considering that both xChrome and xFirefox import this module as part of their config. In any case I’m trying to figure out why these two DSC Resources provided by the PS team are more correct in the first place when they don’t even contain a schema.mof file, don’t contain the three mentioned functions, and when they should also return the same error about importing xPSDesiredStateConfiguration (I’m assuming the device or person auditing the code does not have the module in any of their module paths)