Skip to content

Instantly share code, notes, and snippets.

@bobalob
Last active December 5, 2016 18:55
Show Gist options
  • Save bobalob/21624d6adbfe487d4bf451e639f1a6fa to your computer and use it in GitHub Desktop.
Save bobalob/21624d6adbfe487d4bf451e639f1a6fa to your computer and use it in GitHub Desktop.
[DSCLocalConfigurationManager()]
Configuration LCM_HTTPSPULL
{
param
(
[Parameter(Mandatory=$true)]
[string[]]$ComputerName,
[Parameter(Mandatory=$true)]
[string]$guid
)
Node $ComputerName {
Settings {
AllowModuleOverwrite = $True
ConfigurationMode = 'ApplyAndAutoCorrect'
RefreshMode = 'Pull'
ConfigurationID = $guid
ActionAfterReboot = 'ContinueConfiguration'
RebootNodeIfNeeded = $true
}
ConfigurationRepositoryWeb DSCHTTPS {
ServerURL = 'https://pullserver.example.com:8080/PSDSCPullServer.svc'
CertificateID = 'PULL_SERVER_CERT_THUMBPRINT_HERE'
AllowUnsecureConnection = $False
}
}
}
$guid=[guid]::NewGuid()
LCM_HTTPSPULL -ComputerName dscclient.example.com -Guid $guid -OutputPath C:\DSC\PullClient
Write-Host "New GUID for this computer is $($Guid.guid)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment