How to downlaod files from the web (through proxy) using powershell

0 Flares Filament.io 0 Flares ×

Today I had to download around 900 files from ftp server, however firewall was blocking almost everything, however I was able to access the FTP server via web browser (I used one and only IE :)). So a colleague advised me to use wget to download the files, but I’m a kind of MS guy and I’m not get used to using wget, so I decided to use powershell. So I’d like to present you how easy it is to download the files using powershell (I’m  using v.2). What I need are 2 .NET classes [System.Net.Webclient] and because I’m going through proxy [System.Net.Webproxy]. All my files were placed in one folder on ftp server and I wanted download them to predefined folder – that’s my input data, so the simple script goes like that

As you can see it’s pretty easy, there are more comments and input definitions than scripting.

0 Flares LinkedIn 0 Google+ 0 Facebook 0 Twitter 0 Filament.io 0 Flares ×

Leave a Reply

Your email address will not be published. Required fields are marked *