Skip to content
shellmap

curlTransfer data over HTTP, HTTPS, FTP, and many other protocols across all 5 shells

Equivalents in every shell

Bashunix
curl https://example.com
Zshunix
curl https://example.com
Fishunix
curl https://example.com
PowerShellwindows
Invoke-WebRequest https://example.com

`curl` is an alias for `Invoke-WebRequest` in Windows PowerShell 5.1 — different flags. PowerShell 7+ ships the real `curl.exe` and unaliases `curl`.

cmd.exewindows
curl https://example.com

Real `curl.exe` ships with Windows 10 1803+ and Windows Server 2019+. Pre-1803 systems have no native curl.

Worked examples

Download a file to disk

Bash
curl -O https://example.com/file.zip
PowerShell
Invoke-WebRequest https://example.com/file.zip -OutFile file.zip
cmd.exe
curl -O https://example.com/file.zip

POST JSON to an API

Bash
curl -X POST -H "Content-Type: application/json" -d '{"name":"a"}' https://api.example.com/items
PowerShell
Invoke-RestMethod -Method Post -Uri https://api.example.com/items -ContentType application/json -Body '{"name":"a"}'
cmd.exe
curl -X POST -H "Content-Type: application/json" -d "{\"name\":\"a\"}" https://api.example.com/items

Follow redirects and show response headers only

Bash
curl -LI https://example.com
PowerShell
(Invoke-WebRequest -Method Head https://example.com -MaximumRedirection 10).Headers
cmd.exe
curl -LI https://example.com

Gotchas

  • Windows PowerShell 5.1 aliases `curl` → `Invoke-WebRequest`, so `curl -O url` silently fails because `-O` means something different. Use the full `Invoke-WebRequest -OutFile`, or call `curl.exe` explicitly.
  • `Invoke-WebRequest` parses HTML by default (slow on big pages); use `-UseBasicParsing` on older PowerShell to skip the DOM.
  • cmd built-in HTTP is non-existent — `curl` is the standard tool, available natively only on Windows 10 1803 and later.

WSL & PowerShell Core notes

pwshPowerShell Core 7+ removes the `curl` alias on every platform, so `curl` invokes the real `curl.exe` (Windows 10 1803+) or `/usr/bin/curl` (Linux/macOS). For HTTP work that should stay in PowerShell objects, prefer `Invoke-RestMethod` (JSON-aware) over `Invoke-WebRequest`.
WSLWSL ships the real Linux `curl`. CA trust is independent: WSL uses `/etc/ssl/certs/ca-certificates.crt`, not the Windows certificate store. To trust a corporate root inside WSL, install it via `sudo cp myroot.crt /usr/local/share/ca-certificates/ && sudo update-ca-certificates`.

Related glossary

Common tasks using curl

Related commands