Skip to content

Instantly share code, notes, and snippets.

@duffney
Created March 6, 2017 13:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save duffney/4bf617655382d8e6fe7dc7a18b67c62c to your computer and use it in GitHub Desktop.
Save duffney/4bf617655382d8e6fe7dc7a18b67c62c to your computer and use it in GitHub Desktop.
Simple Web Server DSC Configuration for a DSC Pull Server
Configuration WebServer {
Import-DscResource -ModuleName 'PSDesiredStateConfiguration'
Import-DscResource -ModuleName "xWebAdministration"
Node WebServerConfig {
WindowsFeature WindowsServer {
Name = 'Web-Server'
}
File GlobomanticsPath {
DestinationPath = $env:SystemDrive+'\Globomantics'
Type = 'Directory'
Ensure = 'Present'
}
xWebVirtualDirectory Globomantics {
Name = 'Globomantics'
PhysicalPath = $env:SystemDrive+'\Globomantics'
WebApplication = ''
Website = 'Default Web Site'
Ensure = 'Present'
DependsOn = '[File]GlobomanticsPath'
}
}
}
WebServer -OutputPath $env:SystemDrive'\dsc\WebServer'
new-dscchecksum -path $env:SystemDrive'\dsc\WebServer\WebServerConfig.mof'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment