Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
This DSC example contains multiple nodes and compile to multiple MOFs, one for each server. In this example the code configuration is not duplicated, and is instead replicated out for each node during the compile of the MOFs. This is often more effic
Configuration Demo2 {
Param ()
Import-DscResource -ModuleName PSDesiredStateConfiguration
node $AllNodes.NodeName {
WindowsFeature 'Telnet-Client' {
#DependsOn = "[WindowsFeature]Failover-Clustering"
Ensure = "Absent"
Name = "Telnet-Client"
} #telnet
File RequiredDirectory {
Ensure = 'Present'
Type = 'Directory'
DestinationPath = "C:\RequiredDirectory"
} #requiredDirectory
} #allNodes
} #close configuration
$cd = @{
AllNodes = @(
@{ NodeName = 'Server1'},
@{ NodeName = 'Server2'},
@{ NodeName = 'Server3'}
Demo2 -Configuration $cd -outputpath c:\DSC\Test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.