Learn how to download any file from the internet using the command line (PowerShell) in Windows 11 & 10.
It’s not often, but there will be times, such as when you are working in a command-line tool, running scripts, managing a remote server, etc., where you need to download a file or two. For example, I recently connected to a remote web server via PowerShell and needed to download a file from it. Instead of switching applications, I simply ran a file download command that saved it directly from the server to my desktop. The best thing is that the command is simple to understand and remember.
In this simple tutorial, I will show you how you can download files using the command line in Windows 11 and Windows 10. Let’s get started.
Before You Start
This tutorial only focuses on downloading files from the internet, i.e., web URLs. Not for network shares such as SMB, mapped drives, SSH, SFTP, etc.
Download Files Using Command Line (PowerShell) in Windows 11 & 10
To download files using the command line, we will use the PowerShell command line tool with the wget command. Here’s how:
Note: The wget command is an alias for the Invoke-WebRequest PowerShell cmdlet.
- Open the Start menu by pressing the “Windows key”.
- Search for “Windows PowerShell” and click “Open“.
- Run the following command, replacing “YOUR_URL_HERE” with the actual download URL and “YOUR_FILENAME.EXT” with the desired file name and extension you want to save it as.
wget "YOUR_URL_HERE" -O "YOUR_FILENAME.EXT" - As soon as you run the command, the file will be downloaded to your home directory (C:\Users\YourUsername).
Detailed Steps (With Screenshots)
First, we must open PowerShell. To do that, press the “Windows key” to open the Start menu, search for “PowerShell“, and click the “Open” option.
Note: Windows 11 users can use the terminal by right-clicking the Windows icon on the taskbar and selecting “Terminal”. It opens with the PowerShell tab active.

In your PowerShell or Terminal window, execute the command below to download a file from the internet.
- Replace YOUR_URL_HERE with the actual download link (URL) of the file.
- Replace YOUR_FILENAME.EXT with the desired name and extension for the saved file (e.g., my_downloaded_image.jpg or document.pdf).
wget "YOUR_URL_HERE" -O "YOUR_FILENAME.EXT"

Note: To save the downloaded file to a specific location, replace YOUR_FILENAME.EXT with the full path, like “D:\Downloads\document.pdf”.

That is it. After executing the command, PowerShell downloads the file and saves it. If you specified a full path for the output file, it will be saved there. Otherwise (if you only provided a filename), it will be saved to the current directory from which you ran the PowerShell command. (You can see your current directory by typing Get-Location or pwd).