To download a file from a URL in PowerShell, run Invoke-WebRequest with -Uri for the address and -OutFile for where to save it:
Invoke-WebRequest -Uri 'https://example.com/report-2026-10.zip' -OutFile C:\Downloads\report-2026-10.zip
It works in PowerShell 7 and Windows PowerShell 5.1. Below I download a real file, check the response, use BITS for big files, verify the hash and handle errors.
For every example I used the same small, trusted file: the MIT license from Microsoft’s official PowerShell repository on GitHub.
Download a file with Invoke-WebRequest
-OutFile writes the response straight to disk. The folder must already exist, but the file is created or overwritten:
$url = 'https://raw.githubusercontent.com/PowerShell/PowerShell/master/LICENSE.txt'
Invoke-WebRequest -Uri $url -OutFile .\Downloads\LICENSE.txt
Get-Item -Path .\Downloads\LICENSE.txt | Select-Object -Property Name, Length
Get-Content -Path .\Downloads\LICENSE.txt -TotalCount 1
Output:
Name Length
---- ------
LICENSE.txt 1074
Copyright (c) Microsoft Corporation.

In PowerShell 7.4 and later you can pass just a folder to -OutFile, and it uses the file name from the URL.
Speed up downloads in Windows PowerShell 5.1
In 5.1, the progress bar can make large downloads many times slower. Turn it off for the session before you download:
$ProgressPreference = 'SilentlyContinue'
PowerShell 7 doesn’t have this problem, so you only need the line in 5.1 scripts.
Invoke-WebRequest can do much more than downloads, as shown in PowerShell Invoke-WebRequest.
Check the response
With -OutFile, Invoke-WebRequest returns nothing. Add -PassThru to also get the response object, so you can check the status code and headers:
$url = 'https://raw.githubusercontent.com/PowerShell/PowerShell/master/LICENSE.txt'
$response = Invoke-WebRequest -Uri $url -OutFile .\Downloads\LICENSE.txt -PassThru -UseBasicParsing
"Status: $($response.StatusCode)"
"Content-Type: $($response.Headers['Content-Type'])"
Output:
Status: 200
Content-Type: text/plain; charset=utf-8
-UseBasicParsing only matters in 5.1, where it skips the Internet Explorer engine. PowerShell 7 always parses this way and accepts the switch for compatibility.
Download large files with Start-BitsTransfer
BITS, the Background Intelligent Transfer Service, is what Windows Update uses. It retries after network drops and can run in the background:
$url = 'https://raw.githubusercontent.com/PowerShell/PowerShell/master/LICENSE.txt'
Start-BitsTransfer -Source $url -Destination .\Downloads\LICENSE-bits.txt
"Downloaded $((Get-Item -Path .\Downloads\LICENSE-bits.txt).Length) bytes with BITS"
Output:
Downloaded 1074 bytes with BITS

Add -Asynchronous to start the transfer and get your prompt back, then finish it with Complete-BitsTransfer. BITS only works on Windows.
Verify the download with Get-FileHash
When a vendor publishes a SHA256 checksum, compare it before you open the file. Get-FileHash computes it for you:
$url = 'https://raw.githubusercontent.com/PowerShell/PowerShell/master/LICENSE.txt'
Invoke-WebRequest -Uri $url -OutFile .\Downloads\LICENSE.txt
$hash = Get-FileHash -P