=============================================== | |
Option #1 | |
=============================================== | |
Try using the --% operator to put PowerShell into simple (dumb) argument parsing mode: | |
$ curl.exe --% -ku user@email:mypass -X PUT -d "data={\"password\":\"keypass\"}" https://build.phonegap.com/api/v1/key | |
=============================================== | |
Option #2 - Use splatting. | |
=============================================== | |
$CurlArgument = '-u', 'xxx@gmail.com:yyyy', | |
'-X', 'POST', | |
'https://xxx.bitbucket.org/1.0/repositories/abcd/efg/pull-requests/2229/comments', | |
'--data', 'content=success' | |
$CURLEXE = 'C:\Program Files\Git\mingw64\bin\curl.exe' | |
& $CURLEXE @CurlArgument | |
=============================================== | |
Option #3 - | |
=============================================== | |
Here are a few ways to do so. 1. download curl.exe and point a variable to it then pass the command to it | |
$curlExe = "C:\download\curl-7.59.0\src\curl.exe" | |
& $curlExe -i -k -X POST -d '"{\"groupId\": xxxx}"' "https://site/site?access_token=zzzzzz" -s | |
=============================================== | |
Option #4 - | |
=============================================== | |
Invoke-RestMethod -uri https://site Get -Headers @{"x-api-key" = "mykey"} -ContentType "application/vnd.api+json" -Credential $adminCredential |
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND