【问题标题】:Is there a way to force the Invoke-DscResource cmdlet?有没有办法强制 Invoke-DscResource cmdlet?
【发布时间】:2021-08-07 01:40:52
【问题描述】:

我正在尝试在一系列测试中使用 Invoke-DscResource cmdlet(使用 Pester)来查看配置是否已成功应用于 VM。

这工作 9/10 次,但有时会抛出以下错误:

==> azure-arm.dsc_node: Cannot invoke the Invoke-DscResource cmdlet. The Consistency Check or Pull cmdlet is in progress and must return
==> azure-arm.dsc_node: before Invoke-DscResource can be invoked. Use -Force option if that is available to cancel the current operation.
==> azure-arm.dsc_node:     + CategoryInfo          : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
==> azure-arm.dsc_node:     + FullyQualifiedErrorId : MI RESULT 1
==> azure-arm.dsc_node:     + PSComputerName        : localhost

有没有办法强制调用 Invoke-DscResource cmdlet?

【问题讨论】:

    标签: azure powershell powershell-2.0 dsc pester


    【解决方案1】:

    问题是 Desired State Configuration 无法在另一个进程正在更改机器配置的同时运行。

    我猜你是在你正在测试的过程完成之前运行 Invoke-DscResource。

    尝试暂停测试。

    【讨论】:

    • 配置完全应用后,我会从 Azure 自动化帐户注销 VM。有没有办法暂停 LCM 以便我可以在测试中运行 Invoke-DscResource?
    猜你喜欢
    • 1970-01-01
    • 2013-10-01
    • 2014-04-17
    • 2014-01-02
    • 2017-12-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-11
    • 2020-05-17
    相关资源
    最近更新 更多