I understand the basics of DSC, and can write basic DSC configurations very easily, but I’m trying to figure out what the best practices are, and what a “perfect” DSC configuration is supposed to function, and look like.
Some of the things I have a hard time understanding is that a lot of blogs out there recommend that I use a separate .pds1 file to load in all of the environment specific data, like all of the nodes their roles etc. but why would I want that? It’s loaded in with the restricted language mode so it’s more or less static, I mean sure I can load it in and then dynamically add stuff to it, but then why bother with the .psd1 file at all? I could just keep it in a proper script file, or at the top of the code and then create it dynamically with a computer list from AD or whatever.
Another thing is that DSC looks and feels just like normal functions, and usually a function is supposed to only do one thing but do it well. Yet the ISE default snippet for a DSC configuration and most blogs I can find seem to indicate that you are supposed to have more than one “role” inside a single configuration and separate the nodes with a “role” property and a where statement. Why wouldn’t I want to split up the configurations so the DNS servers have one standalone configuration, and web servers have another? And speaking of configurations looking like functions, what am I supposed to call them? Configure-DNSserver? DNSconfiguration? Something else?