Skip to content

Instantly share code, notes, and snippets.

@techthoughts2
Last active June 10, 2018 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techthoughts2/7f8059e3289f420eafb34af625c4ec7f to your computer and use it in GitHub Desktop.
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
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