Skip to content

Instantly share code, notes, and snippets.

@techthoughts2
Last active June 10, 2018 18:55
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/ad013b46621aad5c08f53a26900d551d to your computer and use it in GitHub Desktop.
Save techthoughts2/ad013b46621aad5c08f53a26900d551d to your computer and use it in GitHub Desktop.
Basic DSC example of simple configuration using localhost. The compiled MOF could be pulled to a variety of different servers or renamed and pushed to a variety of different servers
Configuration Demo3 {
Param ()
Import-DscResource -ModuleName PSDesiredStateConfiguration
node localhost {
#------------------------------------
WindowsFeature 'Telnet-Client' {
#DependsOn = "[WindowsFeature]Failover-Clustering"
Ensure = "Absent"
Name = "Telnet-Client"
} #telnet
#------------------------------------
File RequiredDirectory {
Ensure = 'Present'
Type = 'Directory'
DestinationPath = "C:\RequiredDirectory"
} #requiredDirectory
#------------------------------------
File NewBossRequest {
Ensure = 'Present'
Type = 'Directory'
DestinationPath = "C:\NewDirectory"
} #newBossDirectory
#------------------------------------
} #localhost
} #close configuration
Demo3 -OutputPath C:\DSC\Test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment