Download Files in Windows
Last modified: 2024-09-14
We can download files from websites in Windows from command line.
PowerShell
wget https://example.com/hello.txt -o hello.txt
# or
Invoke-WebRequest -Uri https://example.com/hello.txt -Outfile .\hello.txt
# or
IWR -Uri https://example.com/hello.txt -Outfile .\hello.txt
Command Prompt
We need to call powershell
or powershell.exe
command before actual command.
powershell wget https://example.com/hello.txt -o hello.txt
# or
powershell Invoke-WebRequest -Uri https://example.com/hello.txt -Outfile .\hello.txt
# or
powershell IWR -Uri https://example.com/hello.txt -Outfile .\hello.txt