-1

I am trying to write a script or run directly from a batch from - that will download a file from the internet and place it in a directory that the script was ran from. I can do it already in v3 and v4 but powershell 2.0 is giving me issues. I'm not a programmer so this is basically new to me.

What I want.

Download file from url place file within a directory that the .bat or .ps1 was ran from

Any luck?

  • Describe the issues in detail and show us some code so that we can help you. What, if anything, have you tried already? – andyb Dec 18 '14 at 23:19
  • possible duplicate of [Windows batch file file download from a URL](http://stackoverflow.com/questions/4619088/windows-batch-file-file-download-from-a-url) – Stefan Falk Dec 18 '14 at 23:22
  • Something like this, but one that works on Powershell 2.0 powershell Start-BitsTransfer http://data-cdn.mbamupdates.com/v2/mbam/consumer/data/mbam-setup-2.0.4.1028.exe %~dp0ASE\toolsupdater\Malwarebyte.exe – Adam Pristel Dec 18 '14 at 23:26

1 Answers1

0

You need to import the BitsTransfer module before PowerShell can use BITS functions e.g.

Powershell import-module BitsTransfer; Start-BitsTransfer (source) (destination)
andyb
  • 2,722
  • 1
  • 18
  • 17