“The parameter is incorrect.” error using netsh http add sslcert

后端 未结 18 1599
后悔当初
后悔当初 2020-12-14 05:47

Following the instructions on \"How to: Configure a Port with an SSL Certificate\" in this link: http://msdn.microsoft.com/en-us/library/ms733791.aspx, I entered this comman

18条回答
  •  伪装坚强ぢ
    2020-12-14 06:15

    The PowerShell command line and PowerShell scripts in ps1 files will think curley-braces {...} are PowerShell directives. So quote them. Otherwise, as you have seen, PowerShell will be confused.

    So rather than this (which you found fails):

    netsh http add sslcert ipport:10.141.146.227:7001 certhash=5d48e604007b867ae8a69260a4ad318d2c05d8ff appid= {EDE3C891-306C-40fe-BAD4-895B236A1CC8} 
    

    Do this (note the single quotes):

    netsh http add sslcert ipport:10.141.146.227:7001 certhash=5d48e604007b867ae8a69260a4ad318d2c05d8ff appid= '{EDE3C891-306C-40fe-BAD4-895B236A1CC8}'
    

    Here is some information about PowerShell syntax with curley braces:

    http://danv74.wordpress.com/2012/07/12/powershell-and-the-hidden-art-of-curly-braces-and-other-braces/

提交回复
热议问题