How to run cURL natively in Windows PowerShell

cURL is the de-facto standard command line tool when it comes to sending/receiving requests through one of its many supported many protocol, DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP. In addition to that, curl offer a truck-load of other useful features like FTP upload, proxy support and even Metalink.

In this article, you'll learn how to run curl natively in Windows PowerShell. You must be using Windows 10 to follow the post.

curl on Windows

Since Insider build 17063 and Official build 1804, tar and curl have been added to the Windows toolchain. That happened back in 2018, so if you've installed Windows recently, there's a high chance you already had curl on your system.

You can verify it by opening a Command Prompt and run curl --version to display its current version.

curl on Windows Command Prompt

curl on PowerShell

If your system had curl installed, you can use it natively in PowerShell, skipping the Invoke-WebRequest cmdlet provided by Microsoft.

To be able to run curl in PowerShell, you have to run its executable using curl.exe. See the screenshot below to see what I mean.

image-20210619154200312

That's it, simple. From now on, in PowerShell, you must call curl.exe instead of curl.

image-20210619154544292

Click to rate this post!
[Total: 18 Average: 5]

Leave a Comment