In enterprise environments, you often need credentials:
$url = "http://example.com" $output = "C:\temp\file.zip" $wc = New-Object System.Net.WebClient $wc.DownloadFile($url, $output) Use code with caution. Handling Credentials
Ensure the destination folder has "Write" permissions for the user running the script.
Do not use this method if you cannot trust the standalone binary or lack execution policy permissions.
Import-Module BitsTransfer Start-BitsTransfer -Source "http://example.com" -Destination "C:\temp\file.zip" Use code with caution. Copied to clipboard Method 3: One-Liner (WebClient) If you need to run the command quickly from a prompt: powershell
You're looking for a way to download a file using PowerShell 2.0. Here are a few methods: