Instantly share code, notes, and snippets.

Embed
What would you like to do?
This DSC utilizes the xNetworking community DSC module which has been forked and edited to become a custom module permitting dynamic assignment of IP address.
Configuration Demo4 {
Param ()
Import-DscResource -ModuleName PSDesiredStateConfiguration
Import-DscResource -ModuleName xNetworking
node localhost {
#------------------------------------
WindowsFeature 'Telnet-Client' {
#DependsOn = "[WindowsFeature]Failover-Clustering"
Ensure = "Absent"
Name = "Telnet-Client"
} #clusterPowerShell
#------------------------------------
File RequiredDirectory {
Ensure = 'Present'
Type = 'Directory'
DestinationPath = "C:\RequiredDirectory"
} #requiredDirectory
#------------------------------------
File NewBossRequest {
Ensure = 'Present'
Type = 'Directory'
DestinationPath = "C:\NewDirectory"
} #newBossDirectory
#------------------------------------
xIPAddress SetIP{
InterfaceAlias = "Public"
IPAddress = "192.168.1.5"
AddressFamily = "IPv4"
} #ipAddress
#------------------------------------
} #localhost
} #close configuration
Demo4 -OutputPath C:\DSC\Test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment