Downloading Files

by Sep 21, 2015

Invoke-WebRequest can download files from the internet for you. This example downloads a 33MB public NASA video to your computer, then starts to play it with whatever application is associated with WMV video files on your machine:

#requires -Version 3

$Video = 'http://s3.amazonaws.com/akamai.netstorage/HD_downloads/BEAMextract_final_revB.wmv'
$Destination = "$env:temp\nasavideo1.wmv"
Invoke-WebRequest -Uri $Video -OutFile $Destination -UseBasicParsing

Invoke-Item -Path $Destination

Twitter This Tip! ReTweet this Tip!