Start-DscPullConfiguration

Performs a configuration check on a computer that is using DSC's Pull refresh mode.

Syntax

Start-DscPullConfiguration -ComputerName <String[]> [-Credential <PSCredential>] [-ModuleName <String[]>] [<CommonParameters>]
Start-DscPullConfiguration [-CimSession <CimSession[]>] [-ModuleName <String[]>] [<CommonParameters>]

Description

The most frequently a computer's LCM will download new configuration is every 15 minutes; the most frequently it will apply it is every 30 minutes. This function contacts a computer's LCM and tells it to apply and download its configuration immediately.

If a computer's LCM isn't configured to pull its configuration, an error is written, and nothing happens.

If a configuration check fails, the errors are retrieved from the computer's event log and written out as errors. The Remote Event Log Management firewall rules must be enabled on the computer for this to work. If they aren't, you'll see an error explaining this. The Get-DscError help topic shows how to enable these firewall rules.

Sometimes, the LCM does a really crappy job of updating to the latest version of a module. Start-DscPullConfiguration will delete modules on the target computers. Specify the names of the modules to delete with the ModuleName parameter. Make sure you only delete modules that will get installed by the LCM. Only modules installed in the $env:ProgramFiles\WindowsPowerShell\Modules directory are removed.

Start-DscPullConfiguration is new in Carbon 2.0.

Related Commands

Parameters

Name Type Description Required? Pipeline Input Default Value
ComputerName String[]

The credential to use when connecting to the target computer.

true false
Credential PSCredential

The credentials to use when connecting to the computers.

false false
CimSession CimSession[] false false
ModuleName String[]

Any modules that should be removed from the target computer's PSModulePath (since the LCM does a really crappy job of removing them).

false false

EXAMPLE 1

Start-DscPullConfiguration -ComputerName '10.1.2.3','10.4.5.6'

Demonstrates how to immedately download and apply a computer from its pull server.

EXAMPLE 2

Start-DscPullConfiguration -ComputerName '10.1.2.3' -Credential (Get-Credential domain\username)

Demonstrates how to use custom credentials to contact the remote server.

EXAMPLE 3

Start-DscPullConfiguration -CimSession $session

Demonstrates how to use one or more CIM sessions to invoke a configuration check.

EXAMPLE 4

Start-DScPullConfiguration -ComputerName 'example.com' -ModuleName 'Carbon'

Demonstrates how to delete modules on the target computers, because sometimes the LCM does a really crappy job of it.