我可以使用 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
重新创建它,这允许您提供协议、端口等