{"id":36,"date":"2014-10-27T16:54:31","date_gmt":"2014-10-27T14:54:31","guid":{"rendered":"https:\/\/serverstuff.info\/wordpress\/?p=36"},"modified":"2014-10-27T16:54:31","modified_gmt":"2014-10-27T14:54:31","slug":"download-file-powershell","status":"publish","type":"post","link":"https:\/\/serverstuff.info\/wordpress\/2014\/10\/27\/download-file-powershell\/","title":{"rendered":"Download file with PowerShell"},"content":{"rendered":"<p>So .. I have a windows embedded which doesn&#8217;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 !<br \/>\nAfter a couple of hours of trying to figure out why the heck to my apps keep saying &#8220;don&#8217;t want to run in DOS mode&#8221; .. or not running anything at all ( and weird icons apearing for the app instead of the icon I&#8217;d expect it to have ) .. I got to this:<\/p>\n<pre language=\"powershell\">\r\n$storageDir = $pwd\r\n$webclient = New-Object System.Net.WebClient\r\n$url = \"http:\/\/link\/to\/file\"\r\n$file = \"$storageDir\\myNewFilename.jpg\"\r\n$webclient.DownloadFile($url,$file)\r\n<\/pre>\n<p>I don&#8217;t know exactly why the ftp method didn&#8217;t work YET ..<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So .. I have a windows embedded which doesn&#8217;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 &hellip; <a href=\"https:\/\/serverstuff.info\/wordpress\/2014\/10\/27\/download-file-powershell\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Download file with PowerShell<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,7],"tags":[],"class_list":["post-36","post","type-post","status-publish","format-standard","hentry","category-powershell","category-windows"],"_links":{"self":[{"href":"https:\/\/serverstuff.info\/wordpress\/wp-json\/wp\/v2\/posts\/36","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/serverstuff.info\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/serverstuff.info\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/serverstuff.info\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/serverstuff.info\/wordpress\/wp-json\/wp\/v2\/comments?post=36"}],"version-history":[{"count":1,"href":"https:\/\/serverstuff.info\/wordpress\/wp-json\/wp\/v2\/posts\/36\/revisions"}],"predecessor-version":[{"id":37,"href":"https:\/\/serverstuff.info\/wordpress\/wp-json\/wp\/v2\/posts\/36\/revisions\/37"}],"wp:attachment":[{"href":"https:\/\/serverstuff.info\/wordpress\/wp-json\/wp\/v2\/media?parent=36"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/serverstuff.info\/wordpress\/wp-json\/wp\/v2\/categories?post=36"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/serverstuff.info\/wordpress\/wp-json\/wp\/v2\/tags?post=36"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}