如何在Powershell 5.0 DSC拉模式下设置客户端

如何在Powershell 5.0 DSC拉模式下设置客户端,powershell,dsc,Powershell,Dsc,我为DSC设置了两台服务器,都运行Powershell 5.0和Server 12 R2,DSCPULL配置为通过HTTP的DSC Pull服务器,DSCIIS是客户端 在DSCIIS上,我正在尝试设置它,以便它通过配置名称从Pull服务器下载配置,我从MSDN网站获取了代码,并对我的要求进行了轻微更改,但它仍然不起作用 [DSCLocalConfigurationManager()] configuration PullClientConfigID { Node localhost

我为DSC设置了两台服务器,都运行Powershell 5.0和Server 12 R2,DSCPULL配置为通过HTTP的DSC Pull服务器,DSCIIS是客户端

在DSCIIS上,我正在尝试设置它,以便它通过配置名称从Pull服务器下载配置,我从MSDN网站获取了代码,并对我的要求进行了轻微更改,但它仍然不起作用

[DSCLocalConfigurationManager()]
configuration PullClientConfigID
{
    Node localhost
    {
        Settings
        {
            RefreshMode = 'Pull'
            RefreshFrequencyMins = 30 
            RebootNodeIfNeeded = $true
        }

        ConfigurationRepositoryWeb DSCPULL
        {
            ServerURL = 'http://DSCPULL:8080/PSDSCPullServer.svc'
            RegistrationKey = 'test'
            ConfigurationNames = @('WebServer')
            AllowUnsecureConnection = $true
        }
    }
}

PullClientConfigID -OutputPath c:\Configs\TargetNodes
Start-DscConfiguration C:\Configs\TargetNodes -ComputerName localhost -wait -Verbose
我收到的错误是

Start-DscConfiguration : The computer-specific MOF file for computer localhost does not exist in the current directory.
At line:1 char:1
+ Start-DscConfiguration C:\Configs\TargetNodes -ComputerName localhost ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Start-DscConfiguration], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.DesiredStateConfiguration.Commands.StartDscConfiguration 
   Command

我已尝试将“Node Localhost”更改为服务器名称,然后使用正确的“ComputerName”运行最后一行,但出现了相同的错误。

我应该使用Set-DSCLocalConfigurationManager not Start DSCConfiguration

Set-DSCLocalConfigurationManager localhost –Path C:\Configs\TargetNodes –Verbose