cURL → PowerShell converter
Paste a curl command — including your browser's Copy as cURL (bash) — and get ready-to-paste PowerShell Invoke-RestMethod code. It all happens in your browser: nothing is uploaded.
Converts automatically as you type — nothing leaves your browser.
Your PowerShell code will appear here.
Want to keep this request, not just copy it?
A pasted snippet is gone by the next sprint. The same request as a .http file lives in your repo, re-runs whenever you need it, and diffs like the rest of your code.
Convert this cURL command to a .http file insteadRun .http files natively on Windows.
What it does
- Emits an Invoke-RestMethod call ready to paste
- Understands methods (-X), headers (-H), cookies, user-agent
- Maps Content-Type to -ContentType; bodies to here-strings
- Basic auth (-u) → an Authorization header
- Parses your browser's Copy as cURL (bash) output
Keep the request, not just the code
Code goes stale the moment the endpoint changes. Keep the request as a .http file you can re-run and diff — convert cURL → .http instead, or open it in Karve.
Need C# instead? cURL → C#cURL in PowerShell: what trips people up
In Windows PowerShell 5.1, curl is not curl
Windows PowerShell 5.1 ships curl and wget as aliases for Invoke-WebRequest. Paste curl -H "Accept: application/json" … and PowerShell tries to bind -H to a cmdlet parameter, so it fails with "Cannot bind parameter 'Headers'" or a similar error. PowerShell 7 removed those aliases.
Two fixes: run the real binary as curl.exe (bundled with Windows 10 1803 and later), or convert the command to native PowerShell with the tool above.
Invoke-RestMethod vs Invoke-WebRequest
Invoke-RestMethod parses the response body: JSON comes back as objects you can query ($r.items[0].id). That's why this converter emits it. Invoke-WebRequest returns the whole response — StatusCode, Headers, and the raw Content string. Use it when you need status codes or headers.
Both throw on 4xx/5xx responses. PowerShell 7 adds -SkipHttpErrorCheck and -StatusCodeVariable to inspect errors without try/catch. On 5.1, add -UseBasicParsing to Invoke-WebRequest so it doesn't depend on the Internet Explorer engine.
Quoting pitfalls
- Double quotes expand variables. "Bearer $token" inserts $token, but a JSON body in double quotes can expand by accident. Single quotes are literal, which is why bodies are emitted as @' … '@ here-strings.
- Line continuation is a backtick, not a backslash. A bash command with trailing \ won't paste into PowerShell as-is. ` continues a line, but a trailing space after it breaks the command.
- JSON passed to curl.exe loses its quotes. Before PowerShell 7.3, embedded double quotes in native-command arguments are stripped, so -d '{"a":1}' arrives as {a:1}. Use --% (stop-parsing), write the body to a file and pass -d @body.json, or switch to Invoke-RestMethod.
Common questions
Why doesn't my curl command work in PowerShell?
In Windows PowerShell 5.1, curl is an alias for Invoke-WebRequest, which doesn't understand curl flags. Type curl.exe to run real curl, or convert the command to Invoke-RestMethod above.
Should I use Invoke-RestMethod or Invoke-WebRequest?
Invoke-RestMethod when you want the parsed body (JSON becomes objects). Invoke-WebRequest when you need the status code, headers, or raw content.
How do I convert a cURL command to PowerShell?
Paste the command above — it's parsed in your browser into ready-to-paste PowerShell that calls Invoke-RestMethod, with method, headers, and body filled in.
Does the output use Invoke-RestMethod?
Yes — it maps Content-Type to -ContentType and request bodies to single-quoted here-strings so JSON stays intact.
Will it run on Windows PowerShell and PowerShell 7?
Yes. Invoke-RestMethod ships with both Windows PowerShell 5.1 and PowerShell 7, so the command runs in either without extra modules.
Is my cURL command uploaded anywhere?
No. Conversion runs entirely in your browser — nothing you paste, including tokens, leaves your machine.
Keep the request as a .http file.
Generate PowerShell when you need it — but keep, re-run, and debug the request in Karve, the native Windows workspace for .http files.
15-day free trial · No Karve account · No subscription