I’m writing some of my first DSC configurations, but I’m wondering what are the best ways to go about testing.
In production, I plan to use a pull server. But for testing, I’ve been trying to use just 2 boxes. A target, and a box to push from.
So for instance, I got ahead of myself and was putting what I thought to be some very basic configurations into a composite resource and trying to execute it against a remote machine. It was leveraging the cWebAdministration.
I’m trying to think about how to word this without it sounding like I’m rambling, so I’ll just bullet a few of the things I ran into.
- Error: Some Module cannot be loaded because you opted not to run this software now.
I was putting my modules in the \Program Files\WindowsPowershell\Modules directory. I found http://www.ultimaforsan.com/logs/2014/2/7/powershell-dsc-quirks-part-3.html a suggestion to put my modules in the C:\Windows\System32\WindowsPowerShell\v1.0\Modules directory.
That got me farther, but then I encountered a problem with the execution policy. Is everyone signing their scripts? Or using Unrestricted?
Then I was having problems with it saying that cWebsite was not a valid command or or something like that. It was obviously not liking my composite resource.
I played with moving the import-dscresource command from inside the composite module, to the configuration script, but never really got past that. (Anyone know where the import command should go?)
I then just opted to try and just be as simple as possible and do everything in one configuration script.
All I was trying to do was make sure “Default Web Site” was “Absent”, and again I was just getting errors.
I eventually tracked down that the WebAdministration module has a Mandatory Parameter of PhyscialPath in one of the helper functions. Even though it shouldn’t be required to delete the default website.
Well, anyways… That is already turned into rambling. To the point…
Testing these configuration has been a slow painful process, and I’m afraid that once I get something that I think is working and then try and migrate to using a pull server, things will behave differently.
So is best to test the way I’ve been doing it? Or is it actually easier to just start with a pull server, and test that way by forcing a refresh?
Can you still get the verbose output someway when testing in that method?
Last question? Is anyone using the cAppPool resource from the repository? I can’t get it to work at all. I’m getting an error stating that a Get-Targetresource can not be found…