AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 836610
Accepted
Eric
Eric
Asked: 2017-03-07 07:57:52 +0800 CST2017-03-07 07:57:52 +0800 CST 2017-03-07 07:57:52 +0800 CST

DSC 环境资源在 WMF5.1 之后不再工作 - 未检测到 PATH 值?

  • 772

我有许多使用环境资源设置路径值的部分 DSC 脚本。我有两个执行此操作的脚本,从 WMF5.0 升级到 WMF5.1 后,启动 DscConfigurations 时出现以下错误。

VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = ApplyConfiguration,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer MYCOMPUTER with user sid S-1-5-21-1064954374-356710528-937385128-34335.
VERBOSE: [DESTCOMPUTER]:                            [] Starting consistency engine.
The resources ('[Environment]SetInstantClientPath' and '[Environment]SqlCmdPath') have conflicting values of the following properties: 'Value'. Ensure that their values match.  Merging of partial configurations failed. LCM 
failed to start desired state configuration manually.
    + CategoryInfo          : ResourceExists: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : MI RESULT 11
    + PSComputerName        : DESTCOMPUTER

一个脚本执行此操作:

Environment SqlCmdPath {
    Name = "Path"
    DependsOn = "[Package]InstallSQLServer2012CmdLineUtils_64bit"
    Ensure = "Present"
    Path = $true
    Value = "$env:ProgramFiles\Microsoft SQL Server\110\Tools\Binn"
}

另一个脚本执行此操作:

Environment SetInstantClientPath {
    Name = "Path"
    DependsOn = "[Archive]InstallInstantClientBasic","[Archive]InstallInstantClientSqlplus"
    Ensure = "Present"
    Path = $true
    Value = "$env:SystemDrive\instantclient_11_2"
}

这曾经从 WMF5.0 愉快地运行

自 WMF5.1 以来有什么变化吗?

powershell dsc
  • 1 1 个回答
  • 583 Views

1 个回答

  • Voted
  1. Best Answer
    Colyn1337
    2017-03-08T06:24:23+08:002017-03-08T06:24:23+08:00

    您有两个具有相同名称参数值的环境资源(变量)。当引擎开始创建环境变量时,这可能会导致冲突。我建议你改成这样:

    Environment SqlCmdPath {
        Name = "SqlCmdPath"
        DependsOn = "[Package]InstallSQLServer2012CmdLineUtils_64bit"
        Ensure = "Present"
        Path = $true
        Value = "$env:ProgramFiles\Microsoft SQL Server\110\Tools\Binn"
    }
    Environment SetInstantClientPath {
        Name = "SetInstantClientPath"
        DependsOn = "[Archive]InstallInstantClientBasic","[Archive]InstallInstantClientSqlplus"
        Ensure = "Present"
        Path = $true
        Value = "$env:SystemDrive\instantclient_11_2"
    }
    

    https://msdn.microsoft.com/en-us/powershell/dsc/environmentresource

    只是一个快速更新,但目前 MSFT 有一个关于这个确切问题的请求......

    https://windowsserver.uservoice.com/forums/301869-powershell/suggestions/11088876-dsc-environment-resource-does-not-allow-duplicate

    • 2

相关问题

  • 资源锁和电源外壳

  • 脚本 - 如何断开远程桌面会话?

  • 如何限制向通讯组发送到外部地址?

  • Powershell对值与数组的作用不同?

  • Windows Powershell Vim 键绑定

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve