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 = ''
$Destination = "$env:temp\nasavideo1.wmv"
Invoke-WebRequest -Uri $Video -OutFile $Destination -UseBasicParsing

Invoke-Item -Path $Destination

Twitter This Tip! ReTweet this Tip!