Created
March 9, 2021 19:04
-
-
Save signalwarrant/3dc2b7a6794a7a91db9517dbc4308bbf to your computer and use it in GitHub Desktop.
CreatePullsServer.ps1
This file contains hidden or 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
# Step 1 Install xPSDesiredStateConfiguration | |
Install-Module -Name xPSDesiredStateConfiguration | |
# Step 2 | |
# Create the Pull Server. | |
Configuration CreatePullServer { | |
param ( | |
[string[]]$ComputerName = 'localhost' | |
) | |
Import-DSCResource -ModuleName xPSDesiredStateConfiguration | |
Import-DSCResource –ModuleName PSDesiredStateConfiguration | |
Node $ComputerName { | |
WindowsFeature DSCServiceFeature { | |
Ensure = "Present" | |
Name = "DSC-Service" | |
} | |
xDscWebService PSDSCPullServer { | |
Ensure = "Present" | |
UseSecurityBestPractices = 0 | |
EndpointName = "PSDSCPullServer" | |
Port = 8080 | |
PhysicalPath = "$env:SystemDrive\inetpub\wwwroot\PSDSCPullServer" | |
CertificateThumbPrint = "AllowUnencryptedTraffic" | |
ModulePath = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Modules" | |
ConfigurationPath = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Configuration" | |
State = "Started" | |
DependsOn = "[WindowsFeature]DSCServiceFeature" | |
} | |
} | |
} | |
#Creates the .mof file | |
CreatePullServer | |
# Apply the Pull Server configuration to the Pull Server | |
Start-DscConfiguration .\CreatePullServer -Wait |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment