daily pastebin goal
78%
SHARE
TWEET

PS-CreateDSCConfig.ps1

alcaron Feb 7th, 2014 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Configuration Create_xDscWebService
  2. {
  3.     param  
  4.     (
  5.         [string[]]$NodeName = 'localhost',
  6.  
  7.         [ValidateNotNullOrEmpty()]
  8.         [string] $certificateThumbPrint
  9.     )
  10.  
  11.     Import-DSCResource -Module xPSDesiredStateConfiguration
  12.  
  13.     Node $NodeName
  14.     {
  15.         WindowsFeature WebServer
  16.         {
  17.             Ensure = "Present" # To uninstall the role, set Ensure to "Absent"
  18.             Name = "Web-Server"  
  19.         }
  20.  
  21.         WindowsFeature IISMgmtTools
  22.         {
  23.             Ensure = "Present"
  24.             Name   = "Web-Mgmt-Tools"            
  25.         }
  26.  
  27.         WindowsFeature IISMgmtCon
  28.         {
  29.             Ensure = "Present"
  30.             Name   = "Web-Mgmt-Console"            
  31.         }
  32.  
  33.         WindowsFeature IISScriptingTools
  34.         {
  35.             Ensure = "Present"
  36.             Name   = "Web-Scripting-Tools"            
  37.         }
  38.  
  39.         WindowsFeature DSCServiceFeature
  40.         {
  41.             Ensure = "Present"
  42.             Name   = "DSC-Service"            
  43.         }
  44.  
  45.         xDscWebService PSDSCPullServer
  46.         {
  47.             Ensure                  = "Present"
  48.             EndpointName            = "PSDSCPullServer"
  49.             Port                    = 80
  50.             PhysicalPath            = "$env:SystemDrive\inetpub\wwwroot\PSDSCPullServer"
  51.             CertificateThumbPrint   = "AllowUnencryptedTraffic"
  52.             ModulePath              = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Modules"
  53.             ConfigurationPath       = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Configuration"            
  54.             State                   = "Started"
  55.             DependsOn               = "[WindowsFeature]DSCServiceFeature"                        
  56.         }
  57.  
  58.         xDscWebService PSDSCComplianceServer
  59.         {
  60.             Ensure                  = "Present"
  61.             EndpointName            = "PSDSCComplianceServer"
  62.             Port                    = 8080
  63.             PhysicalPath            = "$env:SystemDrive\inetpub\wwwroot\PSDSCComplianceServer"
  64.             CertificateThumbPrint   = "AllowUnencryptedTraffic"
  65.             State                   = "Started"
  66.             IsComplianceServer      = $true
  67.             DependsOn               = @("[WindowsFeature]DSCServiceFeature","[xDSCWebService]PSDSCPullServer")
  68.         }
  69.     }
  70. }
  71.  
  72. Create_xDscWebService -OutputPath <outputpath>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top