Powershell 使用chef windows cookbook向windows应用商店添加证书

Powershell 使用chef windows cookbook向windows应用商店添加证书,powershell,chef-infra,pfx,Powershell,Chef Infra,Pfx,我正在使用厨师超级市场提供的“windows”烹饪书,当我使用“windows\u证书”资源时,我得到以下错误信息 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. " + CategoryInf

我正在使用厨师超级市场提供的“windows”烹饪书,当我使用“windows\u证书”资源时,我得到以下错误信息

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

您是否在配方的前面创建了文件
c:/temp/cert.pfx
?您可能还需要提供
store\u name
,以告诉Chef如果证书不是默认的某个证书存储,那么实际将证书放在何处。
chef cookbooks/windows
recipe中还有一条说明,由于某些限制,将证书安装到用户存储区并不总是在WinRM上工作。

您是否在配方的前面创建了文件
c:/temp/cert.pfx
?您可能还需要提供
store\u name
,以告诉Chef如果证书不是默认的某个证书存储,那么实际将证书放在何处。
chef cookbooks/windows
recipe中还有一条说明,由于某些限制,将证书安装到用户存储并不总是在WinRM上工作