cURL converter · PowerShell

cURL to PowerShell

Paste a curl command and get a splatted Invoke-RestMethod call. We build a real hashtable for headers, use -Body for JSON, -Form for -F uploads, and translate -u into a PSCredential instead of stringifying auth into the URL.

InputcURL command
1 secret
MethodPOST·Headers2·Body46 B· Chars 187
OutputShell · Invoke-RestMethod(PowerShell 7+)
$headers = @{
  "Authorization" = "Bearer sk_test_123"
}
$body = "{`"to`":`"+15551234567`",`"body`":`"Hello from curl`"}"

$response = Invoke-RestMethod `
  -Uri "https://api.example.com/v1/messages" `
  -Method "POST" `
  -Headers $headers `
  -ContentType "application/json" `
  -Body $body `
  -MaximumRedirection 0
$response | ConvertTo-Json -Depth 10
Inspect

Top guides for PowerShell

All guides →

Common questions

Invoke-RestMethod or Invoke-WebRequest?
We default to Invoke-RestMethod because you usually want the parsed response. Invoke-WebRequest is right when you need raw bytes, redirects with cookies, or the full HTTP response object.
Does the alias `curl` on Windows work?
It's not real curl on older PowerShell — it aliases to Invoke-WebRequest with different flags. This tool emits the native cmdlet so your script is portable and doesn't rely on the alias.
PowerShell 5.1 or 7+?
The output targets PowerShell 7+ (cross-platform). Flags like -SkipCertificateCheck and -Authentication Basic don't exist in 5.1 — drop those two lines to fall back.
Is my curl sent anywhere?
No. Parsing and code generation happen entirely in your browser.

Also convert cURL to

All guides →

Same parser, same idiomatic output — swap the target language whenever your stack changes. Every hub carries its own reference guides for methods, payloads, and auth.