Category Archives: powershell

Download file with PowerShell

So .. I have a windows embedded which doesn’t have internet explorer .. nor explorer shell .. nor any other methods of communicating with the universe ( except the internet itself and ftp ) .. but I had the bright idea to embed powershell !
After a couple of hours of trying to figure out why the heck to my apps keep saying “don’t want to run in DOS mode” .. or not running anything at all ( and weird icons apearing for the app instead of the icon I’d expect it to have ) .. I got to this:

$storageDir = $pwd
$webclient = New-Object System.Net.WebClient
$url = "http://link/to/file"
$file = "$storageDir\myNewFilename.jpg"
$webclient.DownloadFile($url,$file)

I don’t know exactly why the ftp method didn’t work YET ..