cURL-PowerShell

Use cURL in PowerShell

Use cURL in PowerShell

What’s that? cURL in PowerShell? What are you doing he-you’re just Invoke-WebRequest aren’t you?

Imposter is revealed to be Invoke-WebRequest all along!

Yep! You can kind of use cURL commands in Windows Powershell. This “cURL” is actually just an alias of Invoke-WebRequest.

Get-Command curl

Which will return:

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Alias           curl -> Invoke-WebRequest                                            

Very sneaky PowerShell. You can use curl instead of entering Invoke-WebRequest and still use the same parameters of Invoke-WebRequest (ie. -Uri, -Body, -Method). This also means you can’t use the parameters of the actual cURL (ie. -X, -H, -d). With that in mind, you can do something that looks like a cURL GET request:

curl "https://reqbin.com/echo"

and get back:

StatusCode        : 200
StatusDescription : OK
Content           : <html><head><title>ReqBin Echo</title><meta name="description" content="ReqBin Echo Interface"><meta 
                    charset="utf-8"><meta name="viewport" content="width=device-width"><link rel="shortcut icon" href="...
RawContent        : HTTP/1.1 200 OK
                    Transfer-Encoding: chunked
                    Connection: keep-alive
                    Access-Control-Allow-Origin: *
                    CF-Cache-Status: HIT
                    Age: 6732
                    Expect-CT: max-age=604800, report-uri="https://report-uri.cloudfla...
Forms             : {}
Headers           : {[Transfer-Encoding, chunked], [Connection, keep-alive], [Access-Control-Allow-Origin, *], [CF-Cache-Status, HIT]...}
Images            : {}
InputFields       : {}
Links             : {}
ParsedHtml        : mshtml.HTMLDocumentClass
RawContentLength  : 643

Pretty neat!

Share the Post:

Related Posts

The Infinite Forbidden Set Stats

Yu-Gi-Oh! The Infinite Forbidden launched in the TCG on July 19, 2024. I’ve been excited for this set since its announcement because of the nostalgia-bait of Exodia. As a core set, it’s full of new cards, strategies, and archetypes. The highly anticipated Fiendsmith makes its TCG debut just in time for the Yu-Gi-Oh! NAWCQ. Exodia, White Forest, and Gimmick Puppet get support, and a new TCG-exclusive archetype called Mimighoul makes its debut.

Read More

Help! I’m Missing haptic feedback in Beat Saber

The haptic feedback in Beat Saber just stopped working. I knew it wasn’t the controller since vibrations were working outside of Steam or Beat Saber. I didn’t realize how much the haptic feedback contributed to VR immersion, but wow, did I miss it.

Read More