As with functions, you can create configuration blocks with parameters. These enable you to produce different MOF files by varying the parameter values used when you execute the configuration.
For example, suppose you wanted to add a feature to a node. You could create a specific configuration where you hard code the feature name and the node name. This is not dissimilar to how you copied specific files from DC1
to SRV1
in the use DSC and built-in resources recipe.
Alternatively, you could create a configuration that takes the node name and the service name as parameters and when you run the configuration, PowerShell creates a MOF file that adds the specified service to the specified node. This recipe demonstrates that approach.
One challenge this approach throws up is that, by default, you can only send a single MOF file to a given node. Thus, if you used the earlier recipe and copied files to SRV2
, attempting to send a second MOF file to the system results...