我有curl命令,如何在PowerShell上执行它?
curl -v -H "Content-Type: application/pkcs7-mime" -k --cert C:\certnew.cer --key C:\private.key --pass 123123 --request POST "mysite.com" --data "RequestBodyTemplate"
我在PowerShell中找不到如何用两个证书对请求进行签名
--cert C:\certnew.cer --key C:\private.key --pass 123123
这是我的powershell脚本,它不起作用!
$certPath = "C:\certnew.cer"
$keyPath = "C:\private.key"
$keyPass = "123123"
$url = "https://localhost.com:80/webservice"
$data = "-----BEGIN PKCS7-----
MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAaCA
JIAEgYY8P3htbCB2ZXJzaW9uPSIxLjAiIGVuY29kaW5nPSJVVEYtOCI/Pg0KPHRl
-----END PKCS7-----"
$CURLEXE = 'C:\curl\bin\curl.exe'
$CurlArgument = '-v', '-H', 'Content-Type: application/pkcs7-mime',
'-k', '--cert', $certPath,
'--key', $keyPath, '--pass', $keyPass
'--request', 'POST', "$url",
'--data', $data
& $CURLEXE @CurlArgument
我得到一个错误:
curl.exe : curl: no URL specified!