Skip to content

Instantly share code, notes, and snippets.

@duffney
Created February 2, 2016 18:49
Show Gist options
  • Save duffney/aa2a51ab565fa607af75 to your computer and use it in GitHub Desktop.
Save duffney/aa2a51ab565fa607af75 to your computer and use it in GitHub Desktop.
configuration HTTPSPullServer
{
# Modules must exist on target pull server
Import-DSCResource -ModuleName xPSDesiredStateConfiguration -ModuleVersion 3.6.0.0
Import-DSCResource -ModuleName PSDesiredStateConfiguration
Node ZPull01
{
WindowsFeature DSCServiceFeature
{
Ensure = "Present"
Name = "DSC-Service"
}
WindowsFeature IISConsole {
Ensure = "Present"
Name = "Web-Mgmt-Console"
}
xDscWebService PSDSCPullServer
{
Ensure = "Present"
EndpointName = "PSDSCPullServer"
Port = 8080
PhysicalPath = "$env:SystemDrive\inetpub\wwwroot\PSDSCPullServer"
CertificateThumbPrint = '59C31226752787FE0BAB37ECA23C14B4B9524A70'
ModulePath = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Modules"
ConfigurationPath = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Configuration"
State = "Started"
DependsOn = "[WindowsFeature]DSCServiceFeature"
}
xDscWebService PSDSCComplianceServer
{
Ensure = "Present"
EndpointName = "PSDSCComplianceServer"
Port = 9080
PhysicalPath = "$env:SystemDrive\inetpub\wwwroot\PSDSCComplianceServer"
CertificateThumbPrint = "AllowUnencryptedTraffic"
State = "Started"
IsComplianceServer = $true
DependsOn = ("[WindowsFeature]DSCServiceFeature","[xDSCWebService]PSDSCPullServer")
}
}
}
# Generate MOF
if((Test-Path -Path c:\DSC) -eq $false){
mkdir C:\DSC
}
Set-Location C:\DSC
HTTPSPullServer -OutputPath C:\DSC\HTTPS
Start-DscConfiguration -Path C:\dsc\HTTPS -Wait -Verbose -Force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment