【问题标题】:adding certificate to windows store using chef windows cookbook使用 Chef Windows Cookbook 将证书添加到 Windows 商店
【发布时间】:2018-02-06 01:21:16
【问题描述】:

我正在使用厨师超市提供的“windows”食谱,当我使用“windows_certificate”资源时出现以下错误

STDOUT:
STDERR: C:\Users\pratikg\AppData\Local\Temp\chef-script20160712-8616-xwbm5w.ps1 : Exception calling ".ctor" with "3"
argument(s): "Cannot find the requested object.
"
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,chef-script20160712-8616-xwbm5w.ps1
---- End output of "C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -Execu
tionPolicy Bypass -InputFormat None -File "C:/Users/pratikg/AppData/Local/Temp/chef-script20160712-8616-xwbm5w.ps1" ----

Ran "C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypa
ss -InputFormat None -File "C:/Users/pratikg/AppData/Local/Temp/chef-script20160712-8616-xwbm5w.ps1" returned 1

我已将以下代码添加到我的食谱中

windows_certificate "c:/temp/cert.pfx" do     
    pfx_password    "password"   
end

以下是版本详情

Cookbook version - 1.44.1
Chef-client version - 12.11.18
Platform Details - Windows 7 64bit & 2012 R2 64bit
Powershell version - 4.0

【问题讨论】:

    标签: powershell chef-infra pfx


    【解决方案1】:

    您之前是否在食谱中创建了文件c:/temp/cert.pfx?您可能还需要提供 store_name 来告诉 Chef 如果证书不默认为某个证书存储,则实际将证书放在哪里。 chef-cookbooks/windows 配方中还有一条说明,由于某些限制,将证书安装到用户存储并不总是在 WinRM 上工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-05-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多