PoshTip #7 – How to retrieve a file from a given URL
You can use Invoke-WebRequest to download files.
First method
To simply download a file through HTTP, you can use this command
wget "http://technet.microsoft.com/" -OutFile "C:\out.html"
wget is an alias for Invoke-WebRequest
Invoke-WebRequest -Uri "http://technet.microsoft.com" -OutFile "C:\out.html"
If the web server requires authentication, you have to use the -Credential parameter
Second method
Use the .NET WebClient object
$WebClient = New-Object System.Net.WebClient $WebClient.DownloadFile("http://technet.microsoft.com/","C:\out.html")