d3r*_*3kk 13 powershell powershell-4.0 dsc
我已经创建了一个我正在迭代的DSC配置,我正在添加新的Package配置,这是我错了.我确定通过忘记在Package块中向MSI安装程序提供/ quiet参数,我可以使Start-DscConfiguration cmdlet"挂起".
在此"挂起"开始时,我停止本地计算机上的DSC配置操作并尝试更正配置问题(通过在我的示例中添加/ quiet参数),然后重新启动DSC操作.现在我在操作期间看到了远程机器的以下内容:
Cannot invoke the SendConfigurationApply method. The PerformRequiredConfigurationChecks method is in progress and must return before SendConfigurationApply can be invoked.
+ CategoryInfo : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : MI RESULT 1
+ PSComputerName : REMOTEMACHINE20
Run Code Online (Sandbox Code Playgroud)
不幸的是,访问正在配置的远程PC我看到类似的错误消息,并重新启动PC似乎并没有纠正错误.
我在网上看过一些关于这个问题的帖子,到目前为止我发现的三个帖子提示:
Gre*_*ray 19
我发现以下工作非常适合重置DSC.请注意,这将删除本地配置,因此您需要重新应用machinename.meta.mof文件.
#Remove all mof files (pending,current,backup,MetaConfig.mof,caches,etc)
rm C:\windows\system32\Configuration\*.mof*
#Kill the LCM/DSC processes
gps wmi* | ? {$_.modules.ModuleName -like "*DSC*"} | stop-process -force
Run Code Online (Sandbox Code Playgroud)
此时,您已准备好使用Set-DscLocalConfigurationManager和更新使用的干净系统Update-DscConfiguration -Wait -Verbose -CimSession machinename
到目前为止,唯一没有解决的问题是损坏的$ env:psmodulepath或缺少Consistency/Reboot检查的计划任务.更新:根据连接上的此项目, WMF 5.0二月预览中删除了一致性/重新启动的计划任务.
您还可以尝试使用 -Force 选项执行 start-dscconfiguration 命令
Start-DscConfiguration -Force ...
Run Code Online (Sandbox Code Playgroud)