Skip to content

Instantly share code, notes, and snippets.

@gaelcolas
Created February 7, 2018 01:43
Embed
What would you like to do?
Configuration MyDscConfig {
# Import the module that has the 'ServerType' configuration
Import-DscResource -ModuleName Platform
# Import the module that has the 'Application' Configuration
Import-DscResource -ModuleName Product
$ConfigurationData.AllNodes.Nodename {
$ConfigurationData.Roles.($Node.Role).configurations.Foreach{
$ConfigurationName = $_
$ConfigurationParameters = $ConfigurationData.Roles.($Node.Role).($ConfigurationName)
# This weird notation is to avoid scoping issues when invoking the DSC Composite Resource
(Get-DscSplattedResource -ResourceName $ConfigurationName -ExecutionName "$($ConfigurationName)_inc" -Properties $ConfigurationParameters -NoInvoke).Invoke($ConfigurationParameters)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment