windows wget equivalent code example

Example 1: how to wget on windows

#you can perform similar to wget with this command in powershell, accept all certs in test mode
 $client = new-object System.Net.WebClient
 [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} ;
 $client.DownloadString("https://url-url-here")

Example 2: download file by command line windows

iwr -outf index.html http://superuser.com

Example 3: download file by command line windows

Invoke-WebRequest -OutFile index.html http://superuser.com

Tags:

Php Example