Skip to content

Instantly share code, notes, and snippets.

@signalwarrant
Created March 9, 2021 19:04
Show Gist options
  • Save signalwarrant/3dc2b7a6794a7a91db9517dbc4308bbf to your computer and use it in GitHub Desktop.
Save signalwarrant/3dc2b7a6794a7a91db9517dbc4308bbf to your computer and use it in GitHub Desktop.
CreatePullsServer.ps1
# 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