Skip to content

Instantly share code, notes, and snippets.

@Dan1el42
Last active April 3, 2017 10:55
Show Gist options
  • Save Dan1el42/14aef31cf43d713a4720 to your computer and use it in GitHub Desktop.
Save Dan1el42/14aef31cf43d713a4720 to your computer and use it in GitHub Desktop.
Trigger node to get latest configuration from pull server and apply immediately. #PowerShell #DSC
Param
(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[String[]]$ComputerName
)
# Gets latest configuration from pull server and apply immediately
$InvokeMethodSplat = @{
ComputerName = $ComputerName
Namespace = 'root/microsoft/windows/desiredstateconfiguration'
ClassName = 'MSFT_DscLocalConfigurationManager'
MethodName = 'PerformRequiredConfigurationChecks'
Arguments = @{Flags = [UInt32]1}
Verbose = $true
}
Invoke-CimMethod @InvokeMethodSplat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment