Just to start, I wouldn’t have gotten this far without the help of the Daves (plural) Dons and Jones’s (also plural) of Powershell.org. So thanks much! I’m ready to put out my first somewhat useful DSC configuration, and I’ve hit a snag. I have composite resources down and working (they generate mofs without issue). But when I go to run it in my “dynamic master config file” (dynamic in that it’s AD connected and uses a few “where” and “foreach”) it goes through without error and without generating any MOFs. I’m kind of scratching my head. Here’s my script:
The above goes through, but no errors and no MOFs.
I have tested the actual composites by running this (I run “PullDemo” instead of “Everything”), and it works / generates MOFs. So I’m fairly certain its not my composites.
Yar there be MOF’s capn’ hehe I need to hit my head with a few powershell books and become a real scripter. The extra braces are from my math knowledge of ‘BEDMAS’ so I know everything needs to be closed… but which brackets/braces to use and where/how many sometimes falls flat on me! The MOFs look good, and now to make the minions listen! haha
Spoke too soon! Closed and re opened powershell and now when I try to run this in a new session I"m given errors like this:
PSDesiredStateConfiguration\Node : The term 'RdsServer\RdsServer' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling
of the name, or if a path was included, verify that the path is correct and try again.
At line:86 char:5
+ Node $allnodes.where({$_.NodeRole -eq "ADDS"}).NodeGuid {
+ ~~~~
+ CategoryInfo : ObjectNotFound: (RdsServer\RdsServer:String) [PSDesiredStateConfiguration\node], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : CommandNotFoundException,PSDesiredStateConfiguration\node
PSDesiredStateConfiguration\Node : The term 'rFileServer\rFileServer' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:90 char:5
+ Node $allnodes.where({$_.NodeRole -eq "SQL"}).NodeGuid {
+ ~~~~
+ CategoryInfo : ObjectNotFound: (rFileServer\rFileServer:String) [PSDesiredStateConfiguration\node], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : CommandNotFoundException,PSDesiredStateConfiguration\node
PSDesiredStateConfiguration\Node : The term 'rFileServer\rFileServer' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:90 char:5
+ Node $allnodes.where({$_.NodeRole -eq "SQL"}).NodeGuid {
+ ~~~~
+ CategoryInfo : ObjectNotFound: (rFileServer\rFileServer:String) [PSDesiredStateConfiguration\node], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : CommandNotFoundException,PSDesiredStateConfiguration\node
PSDesiredStateConfiguration\Node : The term 'rFileServer\rFileServer' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:90 char:5
+ Node $allnodes.where({$_.NodeRole -eq "SQL"}).NodeGuid {
+ ~~~~
+ CategoryInfo : ObjectNotFound: (rFileServer\rFileServer:String) [PSDesiredStateConfiguration\node], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : CommandNotFoundException,PSDesiredStateConfiguration\node
Errors occurred while processing configuration 'Everything'.
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.psm1:2088 char:5
+ throw $errorRecord
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Everything:String) [], InvalidOperationException
+ FullyQualifiedErrorId : FailToProcessConfiguration
I think that means Import-DscResource isn’t finding your composite resources for some reason. Make sure the folder and file structure for the module that contains your composite resources is correct. (You should see them showing up when you run Get-DscResource at the command line.)
Thank goodness for vmware snapshots. in my tiredness I failed to realize what I did.
See, I’ve added a path to powershell’s default module path so that my co workers aren’t digging into programfiles or other places, that our stuff is “our stuff” and it’s clear. I’ve noticed while copy-pasting some of the files out of the latest resource kit that the file names are gigantonormous and give errors, so to evade this I wanted to make instructions to expand things from zip file in the places they go, and I had this script I was writing to make it simple… yeah at this point not a good idea I think I borked it myself.
anyway I’ve gone back to an older snapshot and it’s looking okay. I’ll have to figure it out at a later time that’s not friday, for now I want results!
And lo behold while I try to get results I find the problem…
I copy the modules and their checksums to C:\Program Files\WindowsPowerShell\DscService\Modules so that the LCMs of targets can download modules.
The problem happens after that? I’m using the latest resource package release (version 8). Confirmed this by deleting them and restarting powershell. This is the difference between my MOFs getting generated and the errors I spoke of before.