Last active
June 10, 2018 18:57
-
-
Save techthoughts2/7f8059e3289f420eafb34af625c4ec7f to your computer and use it in GitHub Desktop.
This DSC example contains two server nodes and will compile to two individual MOFs. One for Server1, and one for Server2. In this example the code configuration is duplicated for each node. This is not very efficient and this serves only as an examp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Configuration Demo1 { | |
Param () | |
Import-DscResource -ModuleName PSDesiredStateConfiguration | |
node Server1 { | |
#------------------------------------ | |
WindowsFeature 'Telnet-Client' { | |
#DependsOn = "[WindowsFeature]Failover-Clustering" | |
Ensure = "Absent" | |
Name = "Telnet-Client" | |
} #telnet | |
#------------------------------------ | |
File RequiredDirectory { | |
Ensure = 'Present' | |
Type = 'Directory' | |
DestinationPath = "C:\RequiredDirectory" | |
} #requiredDirectory | |
#------------------------------------ | |
} #server1 | |
node Server2{ | |
#------------------------------------ | |
WindowsFeature 'Telnet-Client' { | |
#DependsOn = "[WindowsFeature]Failover-Clustering" | |
Ensure = "Absent" | |
Name = "Telnet-Client" | |
} #telnet | |
#------------------------------------ | |
File RequiredDirectory { | |
Ensure = 'Present' | |
Type = 'Directory' | |
DestinationPath = "C:\RequiredDirectory" | |
} #requiredDirectory | |
#------------------------------------ | |
} #server2 | |
} #close configuration | |
Demo1 -OutputPath C:\DSC\Test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment