Skip to content

Instantly share code, notes, and snippets.

@jdhitsolutions
Created January 23, 2017 17:52
Show Gist options
  • Save jdhitsolutions/45d17e52e978ccd0948b4953321e9961 to your computer and use it in GitHub Desktop.
Save jdhitsolutions/45d17e52e978ccd0948b4953321e9961 to your computer and use it in GitHub Desktop.
A DSC configuration to reset the local configuration manager
Param(
[string[]]$Computername = "chi-test02"
)
[DscLocalConfigurationManager()]
Configuration ResetLCM {
Param([string[]]$Computername)
Node $Computername {
Settings {
RebootNodeIfNeeded = $True
ConfigurationMode = 'ApplyAndMonitor'
RefreshMode = 'Push'
ActionAfterReboot = 'ContinueConfiguration'
}
}
}
ResetLCM -computername $Computername -out c:\dsc\resetLCM
Set-DscLocalConfigurationManager -Path C:\dsc\resetLCM -ComputerName $Computername -Verbose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment