【发布时间】:2018-04-21 18:43:58
【问题描述】:
我正在 PowerShell 中执行以下命令:
Invoke-Expression "openssl pkcs12 -in $certCN.pfx -nocerts -nodes -out $certCN.key -password pass:1111"
它工作正常,但是来自openssl 的输出导致了丑陋的控制台错误:
openssl : MAC verified OK
At line:1 char:1
+ openssl pkcs12 -in www.mywebsite.com.pfx -nocerts -node ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (MAC verified OK:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
执行此 OpenSSL 命令并将输出忽略或至少不解释为命令的最佳方法是什么?
【问题讨论】:
-
如何尝试让 powershell 脚本运行而没有错误不是又是一个编程问题?
标签: windows powershell command