Set-WebBinding 可以将协议从 HTTP 更改为 HTTPS 吗?



我可以使用 Set-WebBinding 来更改给定绑定的端口,但我可以使用它从端口 80 上的 http 更改为端口 443 上的 https,反之亦然?

我尝试使用此命令,但它失败了,因为它无法识别-PropertyName Protocol

Set-WebBinding -Name 'Default Web Site' -BindingInformation '127.0.0.1:80:localhost'  -PropertyName Port -Value 443 -PropertyName Protocol -Value 'https'

还是我应该使用Remove-WebBinding然后New-WebBinding来进行这样的更改?

我认为您需要使用Remove-WebBinding删除现有绑定并使用New-WebBinding重新创建它,这允许您提供协议、端口等

最新更新