Author Posts

August 5, 2018 at 1:45 am

Watching some vids on DSC and seeing what I can try. How's this look for a first config file? Am I on the right track? The intent of the file would be to make sure PSTools and its contents are where they belong on a system and, if not, put them there and then to also ensure that the PSTools path is available in the PATH variable.

Configuration TechResources
    param (
    Node AComputer
        File $NodeName
            DestinationPath = "c:\Program Files (x86)\PSTools"
            Recurse = True
            Type = Directory 
            SourcePath = FileSystem::"\\SOMESERVERNAME\PSTools"
        Environment $NodeName
            Name = "c:\Program Files (x86)\PSTools"

August 6, 2018 at 2:52 pm

I'm not sure I'd use the node name as the unique identifier for each configuration element. It seems like you'd use the $NodeName in place of "AComputer," unless you're looking specifically to configure a machine named ACOMPUTER.

The Environment resource is for configuring environment variables. I'm not sure what your intent is in using it the way you are. Seems like you'd want to configure the PATH variable to include a specific value, and you'd include the Path setting as $True to ensure your value is concatenated. Docs on that resource are at

August 7, 2018 at 7:15 pm

As Don mentioned, $NodeName will be ideally used for naming Node function and not as unique identifier for each configuration element. There won't be much advantage of making identifier for each configuration element dynamic.

August 12, 2018 at 5:09 am

Thank you both for taking the time to answer.  Yes, the $nodeName was just me not getting it and putting it entirely in the wrong place.  It did go in place of AComputer.  I also did get the environmental path variable to play nice.

But I guess I'm left wondering what's the value of DSC over just having a regular, PoSH script doing the same thing.  I can check if something exists and install if it does not and I can check that environmental variables exist and correct if they do not without having to learn/work through this very different format of doing things.

Can't I just stand up a system and run a standard PowerShell script against it to configure everything just the same?  Please help me understand the differing value of DSC over other methods or, if you could/would, point me to resources that can go deeper on this matter?

Thank you!