windows 服务器 2012 中的 Powershell openssl ObjectNotFound

Powershell openssl ObjectNotFound in windows server 2012

在尝试使用 openssl 工具分两个阶段将 PKCS12 格式的私钥文件转换为 PEM 格式(由 Wireshark 使用)时出现以下错误

PS C:\OpenSSL-Win64\bin> openssl pkcs12 -nodes -in test_cer123456.pfx -out key.pem -nocerts -nodes
openssl : The term 'openssl' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At line:1 char:1
+ openssl pkcs12 -nodes -in test_cer123456.pfx -out key.pem -nocerts -nodes
+ ~~~~~~~
    + CategoryInfo          : ObjectNotFound: (openssl:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException


Suggestion [3,General]: The command openssl was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by
default. If you trust this command, instead type ".\openssl". See "get-help about_Command_Precedence" for more details.
PS C:\OpenSSL-Win64\bin>

有人可以帮我解决这个问题吗?

注意:我在关注 this post

Powershell 不将当前目录作为搜索路径的一部分。错误消息实际上告诉您这一点并解释了该怎么做(强调已添加):

Suggestion [3,General]: The command openssl was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type ".\openssl". See "get-help about_Command_Precedence" for more details.