3/22/10

PowerShell Download File Script

This script downloads files asynchronously. It uses the .NET WebClient DownloadFileAsync method.
Note that the download file path must exist.
downloadFile 'http://www.foo.com/foo.iso' 'c:\temp\foo.iso'

function downloadFile($uri, $filename)
{
  $webClient = new-object net.webclient
  $webClient.downloadFileAsync($uri, $filename)
}

No comments:

Post a Comment