Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell 调用WebRequest时出现SSL/TLS问题_Powershell_Powershell 3.0 - Fatal编程技术网

Powershell 调用WebRequest时出现SSL/TLS问题

Powershell 调用WebRequest时出现SSL/TLS问题,powershell,powershell-3.0,Powershell,Powershell 3.0,我想在PowerShell中运行curl命令,但我遇到了无法连接SSL/TLS的错误 $loginurl= https://education.org/logon $data= New-Object "System.collections.Generic.Dictionary[[String],[String]]" $data.Add('username','abc') $data.Add('password','abc') $method=POST $response= Invoke-Rest

我想在PowerShell中运行
curl
命令,但我遇到了无法连接SSL/TLS的错误

$loginurl= https://education.org/logon
$data= New-Object "System.collections.Generic.Dictionary[[String],[String]]"
$data.Add('username','abc')
$data.Add('password','abc')
$method=POST
$response= Invoke-RestMethod -Method $method -Uri $loginurl -Body $data

$response.RawContent

我试着在Shell中编写它,但在Shell中,我使用了
——不安全的sS
作为另一个工作开关。有谁能在PowerShell中帮助解决这个问题吗?有时它也会给我语法错误

我认为您需要
-SkipCertificateCheck
开关:

Invoke-RestMethod -Method $method -Uri $loginurl -Body $data -SkipCertificateCheck
顺便说一句,创建哈希表的更简单方法如下:

$data = @{'username'='abc';'password'='abc'}

我想您需要
-SkipCertificateCheck
开关:

Invoke-RestMethod -Method $method -Uri $loginurl -Body $data -SkipCertificateCheck
顺便说一句,创建哈希表的更简单方法如下:

$data = @{'username'='abc';'password'='abc'}