Last active
May 4, 2017 07:10
-
-
Save duffney/1bd49fae18da35c811488326cfb441cb to your computer and use it in GitHub Desktop.
DSC config for v2 of the pull server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
configuration DscPullServer | |
{ | |
param | |
( | |
[string[]]$NodeName = 'localhost', | |
[ValidateNotNullOrEmpty()] | |
[string] $certificateThumbPrint, | |
[Parameter(Mandatory)] | |
[ValidateNotNullOrEmpty()] | |
[string] $RegistrationKey | |
) | |
Import-DSCResource -ModuleName PSDesiredStateConfiguration | |
Import-DSCResource -ModuleName xPSDesiredStateConfiguration | |
Node $NodeName | |
{ | |
WindowsFeature DSCServiceFeature | |
{ | |
Ensure = 'Present' | |
Name = 'DSC-Service' | |
} | |
xDscWebService PSDSCPullServer | |
{ | |
Ensure = 'present' | |
EndpointName = 'PSDSCPullServer' | |
Port = 8080 | |
PhysicalPath = "$env:SystemDrive\inetpub\PSDSCPullServer\" | |
CertificateThumbPrint = $certificateThumbPrint | |
ModulePath = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Modules" | |
ConfigurationPath = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Configuration" | |
State = 'Started' | |
DependsOn = '[WindowsFeature]DSCServiceFeature' | |
UseSecurityBestPractices = $true | |
} | |
File RegistrationKeyFile | |
{ | |
Ensure = 'Present' | |
Type = 'File' | |
DestinationPath = "$env:ProgramFiles\WindowsPowerShell\DscService\RegistrationKeys.txt" | |
Contents = $RegistrationKey | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment