The DSC composite resource syntax

The syntax for a DSC composite resource is exactly the same as a DSC configuration block. This makes sense because they are, in effect, the same thing. This is great because it allows you to copy and paste your existing working DSC configuration blocks and encapsulate them inside reusable components without much modification.

The exception to the statement that the syntax is the same is that you do not include the node block inside a DSC composite resource declaration. Since the DSC composite resource is being used inside the main DSC configuration block, it inherits the target node it's being applied to.

Remember when we covered the syntax of a DSC configuration block and said that you could use parameters with a DSC configuration block just like a normal PowerShell function? And that you normally wouldn't because the other DSC features, such as the DSC special variables, are so much more powerful that you don't really need them? Well, with DSC composite resources, the opposite is true. The parameter statement is the entry point for your DSC composite resource and the only way to get configuration data or other information inside it. Any data or variables you expect to use inside the DSC composite resource have to come through the parameter statements.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset