Is there a built-in command-line tool under Windows like wget/curl?

Solution 1:


$wc = New-Object System.Net.WebClient
$wc.DownloadFile($source, $dest)

There's also Invoke-WebRequest in PS 3.0.

Solution 2:


Windows 10 includes curl.exe:

so you can do something like this:

# example 1
curl.exe --output index.html --url
# example 2
curl.exe -o index.html

If you have older Windows, you can still download it:


# example 1
Invoke-WebRequest -OutFile index.html -Uri
# example 2
iwr -outf index.html

Solution 3:

There is no wget like built-in command in Windows. You can use the .net Framework via Windows PowerShell like in this example:

or like i do and use wget for Windows:

Solution 4:

I like http-ping utility. You can run with these settings: ping once and save the contents to google.html

http-ping.exe -n 1 -f google.html

It does not require installation. Check more about http-ping here