我正在设置一个 DSC HTTPS 拉取服务器并正在测试该服务。在浏览器中,我可以使用以下 URL 访问该服务
https://dsc.mydomain.com:8080/PSDSCPullServer.svc/$metadata
但是,使用 PowerShell 的相同 URL 失败。为什么?
Invoke-RestMethod -Uri https://dsc.mydomain.com:8080/PSDSCPullServer.svc/$metadata -Verbose
这是 PowerShell 中的错误:
Invoke-RestMethod : The underlying connection was closed: An unexpected error occurred on a send.
At line:1 char:1
+ Invoke-RestMethod -Uri https://dsc.mydomain.com:8080/PSDSCPullSe ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand