Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Simple cURL in PowerShell 2.0

$
0
0

Among other things, Powershell 2.0 doesn't have the useful cmdlet Invoke-RestMethod. I have application with PS v2 module inside so can't upgrade to version 3 and most examples I've found use version 3. I was wondering is it possible to convert such cURL to powershell v.2?

cURL:
curl -D- -u fred:fred -X POST --data {see below} -H "Content-Type: application/json" http://mydomain.local:8090/rest/api/2/issue/

Data:

{
    "fields": {
       "project":
       {
          "key":"TEST"
       },
       "summary":"REST ye merry gentlemen.",
       "description":"Creating of an issue using project keys and issue type names using the REST API",
       "issuetype": {
          "name":"Bug"
       }
   }
}

Viewing all articles
Browse latest Browse all 6937

Trending Articles