Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there an equivalent of curl in PowerShell? Does it have some similar built-in capability or is there a 3rd party cmdlet?

share|improve this question
1  
Closed? How about closing superuser.com/questions/34492/…;, superuser.com/questions/295021/…, superuser.com/questions/71446/… and host of others? –  Borek Oct 10 '11 at 12:39
1  
Actually this question looks fair enough to me? But there's an old answer: stackoverflow.com/questions/340553/… –  Rup Oct 10 '11 at 12:49
    
@Spoike Nice solution, you should post it as an answer. –  Borek Jan 22 '13 at 14:55
add comment

migrated from stackoverflow.com Oct 10 '11 at 11:36

This question came from our site for professional and enthusiast programmers.

5 Answers

The excellent Command Line Kung Fu blog has a post where they compare curl, wget and the related PowerShell commands

In a nutshell:

(New-Object System.Net.WebClient).DownloadString("http://www.example.com/hello-world.html","C:\hello-world.html")

Or, if your version of Powershell/.Net doesn't accept 2 parameters for DownloadString:

(New-Object System.Net.WebClient).DownloadString("http://www.example.com/hello-world.html") > "C:\hello-world.html"
share|improve this answer
add comment

You can install cURL with Chocolatey and have curl available in PowerShell CLI or cmd.

share|improve this answer
add comment

You can also install Git for Windows, and then put the Git bin folder in your path. The Git install includes, among other things, curl.exe. After installing, just put %programfiles(x86)%\git\bin in your PATH. Then you'll be able to use the curl command from the Windows Command Prompt or PowerShell console.

share|improve this answer
add comment

the closest thing to wget or curl on windows is bits (Background Intelligent Transfer Service), which has some snippets ready for powershell.

share|improve this answer
    
I think BITS solves a different problem than wget or curl. –  ongle Jul 7 '12 at 1:08
    
Fetching things from a Http-Server? –  akira Jul 7 '12 at 19:03
1  
No :), the background intelligence part of it. –  ongle Jul 7 '12 at 20:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.