$url = "http://example.com/file.txt" $outputPath = "C:\Downloads\file.txt"
To download a file, you create a WebClient object and use the DownloadFile method: powershell
So, how do you download a file using PowerShell 2.0? This article provides a definitive guide, including the limitations, the workarounds, and the specific code you need.
PowerShell 2.0 (Windows 7 / Server 2008 R2 default) lacks many modern cmdlets like Invoke-WebRequest or Invoke-RestMethod (introduced in v3.0). However, you can still download files using classes.