参数对于 netsh http 中的主机名端口无效,删除 sslcert

Rya*_*oza 8 windows powershell netsh

我正在尝试在 PowerShell 中运行以下命令:

命令-

netsh http delete sslcert hostnameport="services.localtest.me:443"
Run Code Online (Sandbox Code Playgroud)

结果-

'hostnameport' is not a valid argument for this command.
The syntax supplied for this command is not valid. Check help for the correct syntax.
Run Code Online (Sandbox Code Playgroud)

我收到一条错误消息,指出 hostnameport 不是有效参数,但它在此站点上记录为社区添加。另外,如果您查看 Microsoft 的一些 GitHub 存储库,您会发现它正在被使用,例如在此 PowerShell 脚本中。

这个论点仅在特定版本的 Windows 上有效吗?只能在 Windows Server 上使用吗?我可以在 Windows 功能中启用某些功能来使这个论点起作用吗?

小智 5

请使用以下命令

netsh http delete sslcert hostnameport=localhost:443
Run Code Online (Sandbox Code Playgroud)

参考:http://www.it-word.net/command/Windows/netsh/en-us/netshhttp.html