How to download a file using PowerShell in Windows 10

12 Comments

  1. Exception calling “DownloadFile” with “2” argument(s): “An exception occurred during a WebClient request.”
    At line:1 char:1
    + $client.DownloadFile(“http://thewindowsclub.thewindowsclub.netdna-cdn …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WebException

  2. Have you mentioned both the file URL and destination filename in the command? Can you please share the whole command that you have ran in PowerShell?

  3. $client = new-object System.Net.WebClient
    $client.DownloadFile(“http://thewindowsclub.thewindowsclubco.netdna-cdn.com/wp-content/uploads/2016/06/Copy-Download-Link.png”,“C:UsersLDORONYDesktop1.png”)

  4. Try this command once:

    $client = new-object System.Net.WebClient
    $client.DownloadFile(“http://thewindowsclub.thewindowsclubco.netdna-cdn.com/wp-content/uploads/2016/06/Copy-Download-Link.png”,“C:UsersLDORONYDesktop1.png”)

    Make sure the quotes are placed correctly.

    Also, are you running powershell with administrative privileges?

  5. As on who have lived with and loved PowerShell since it early Monad (it’s original name)…
    https://blogs.msdn.microsoft.com/powershell/2007/03/18/monad-manifesto-the-origin-of-windows-powershell
    http://www.jsnover.com/Docs/MonadManifesto.pdf

    This is ‘not’ a Windows 10 thing and it is really wrong to advertise it that way. You have been able to do this well before Windows 10 ever existed. Now, PoSH v5 in Windows… (and downloadable to earlier versions of Windows Client and Server) https://www.microsoft.com/en-us/download/details.aspx?id=50395 a watershed of new things to the table. But this is not one of them. a watershed of new things to the table. But this is not one of them.

  6. PowerShell for Beginners “http://social.technet.microsoft.com/wiki/contents/articles/4307.powershell-for-beginners.aspx ”

    Getting Started with PowerShell 3.0 Jump Start
    https://mva.microsoft.com/en-us/training-courses/getting-started-with-powershell-3-0-jump-start-8276
    http://www.microsoftvirtualacademy.com/training-courses/advanced-tools-scripting-with-powershell-3-0-jump-start#fbid=wdBipBJLtCB

    What’s New in PowerShell v5 “https://mva.microsoft.com/en-US/training-courses/whats-new-in-powershell-v5-16434”

    Windows PowerShell Survival Guide “http://social.technet.microsoft.com/wiki/contents/articles/183.windows-powershell-survival-guide.aspx”

    YouTube “https://www.youtube.com/results?search_query=powershell+training”

  7. Indeed! This post was covered using Windows 10 (which is now the latest version) and I myself use it! It is nowhere implied that this particular method won’t work in earlier version of Windows :)

  8. Let’s define source and destination first, try this:

    $source = “http://thewindowsclub.thewindowsclubco.netdna-cdn.com/wp-content/uploads/2016/06/Copy-Download-Link.png”

    $destination = “C:UsersLDORONYDesktop1.png”

    $client = new-object System.Net.WebClient

    $client.DownloadFile($source, $destination)

  9. I also have the same issue, what I’m trying to do is copy folders from our http server to a local server, here is what I have

    $source = “http://servername/serverupdates/deploy/Program%20Files/”
    $destination = “C:Program Files”
    $client = new-object System.Net.WebClient
    $client.DownloadFile($source, $destination)

25 Shares
Share via
Copy link
Powered by Social Snap