【发布时间】:2016-04-12 18:40:52
【问题描述】:
我正在尝试通过 PowerShell 脚本安装证书。按照 Microsoft PowerShell 文档中的建议,我正在使用 Import-Certificate 方法。
这是我的代码:
$script = {
$file = ( Get-ChildItem -Path C:\Users\Administrator\Desktop\newCert.cer )
$file | Import-Certificate -CertStoreLocation cert:\CurrentUser\Root
echo $file
}
invoke-command -Credential $clientCred -ComputerName $ClientIP -ScriptBlock $script
我收到以下错误:
UI is not allowed in this operation
+ CategoryInfo : InvalidArgument: (:) [Import-Certificate], ArgumentException
我不确定这是哪里出了问题 - 如果有人能指出我正确的方向,那将非常有帮助。
【问题讨论】:
标签: powershell ssl ssl-certificate