windows – 在PowerShell中运行openssl命令
发布时间:2020-12-14 02:47:44 所属栏目:Windows 来源:网络整理
导读:我在Power Shell中执行以下命令: Invoke-Expression "openssl pkcs12 -in $certCN.pfx -nocerts -nodes -out $certCN.key -password pass:1111" 它工作正常,但openssl的输出导致丑陋的控制台错误: openssl : MAC verified OKAt line:1 char:1+ openssl pkc
我在Power
Shell中执行以下命令:
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命令并忽略输出或至少不将其解释为命令的最佳方法是什么? 解决方法
您不需要Invoke-Expression(实际上,it’s not recommended除外,因为它易受注入).只需运行命令并引用需要变量字符串扩展的参数:
openssl pkcs12 -in "$certCN.pfx" -nocerts -nodes -out "$certCN.key" -password pass:1111 要忽略命令的输出,一种常见的技术是管道输出Out-Null. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 使用fopen增加Windows中Matlab中打开文件描述符的最大数量
- windows – 在Ubuntu中卸载Firefox
- 用于Windows C#的SMS网关
- windows – 无法绑定到端口,即使tcpview说它没有被使用
- windows – 如何在git bash中设置正确的本地时区?
- windows-7 – Windows 7 VPN是否可与Cisco ASA 5510配合使用
- 通过cmd 使用 InstallUtil.exe 命令 操作 windows服务 Wind
- Windows 2008 R2 DHCP – 客户端更新过于频繁
- 10、管理站点复制
- 系统管理员为Windows专家/ Lunix Noob提供Debian / Ubuntu教