DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
Redmond desk5 min

How to Download a File Using PowerShell in Windows 11

Use Invoke-WebRequest with -OutFile to save a file from a direct URL in Windows 11, and learn how Windows PowerShell 5.1 differs from PowerShell 7 and when to use curl.exe or BITS instead.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To download a file in Windows 11 from a direct URL, use Invoke-WebRequest with -OutFile to save the response to a path you choose. That works in Windows PowerShell 5.1, the version built into Windows 11, and in PowerShell 7 if you have installed it separately. The two shells differ in a few details, so check which one you are running before you copy a command.

Check which PowerShell you are running

Windows 11 includes Windows PowerShell 5.1. PowerShell 7 is a separate install with its own executable, pwsh. Commands and aliases can behave differently between them, so confirm your version first.

As an Amazon Associate I earn from qualifying purchases.

  1. Click Start, type powershell, and open Windows PowerShell.
  2. Run $PSVersionTable.PSVersion. A result beginning with 5.1 means Windows PowerShell 5.1.
  3. If you have PowerShell 7 installed, open it from Start by searching for PowerShell 7, or run pwsh from any terminal. Its version will begin with 7.

Method 1: Invoke-WebRequest with -OutFile

This is the native PowerShell approach for saving one HTTP or HTTPS response to a file. The example below builds the destination under your Downloads folder with Join-Path and passes it to -OutFile.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
$url = 'https://example.com/file.zip'
$out = Join-Path $env:USERPROFILE 'Downloadsfile.zip'
Invoke-WebRequest -UseBasicParsing -Uri $url -OutFile $out

Replace the example URL with the direct link to the file. A direct link points at the file itself, not at a web page that has a download button.

Why the -UseBasicParsing switch appears

Microsoft’s Windows PowerShell 5.1 documentation for Invoke-WebRequest says that after the December 9, 2025 security update, the cmdlet can show a prompt about script-execution risk when it parses web page content. Its recommended action is to use the switch: “Use the -UseBasicParsing switch to avoid script code execution.” Add -UseBasicParsing to avoid that prompt on an updated Windows PowerShell 5.1 system.

In PowerShell 7, basic parsing is the only mode. The switch is kept for backward compatibility, so it has no effect there and is harmless to include. The PowerShell 7.6 reference for Invoke-WebRequest documents this behavior.

Rank #2
Dell Latitude 5420 14" FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
  • 256 GB SSD of storage.
  • Multitasking is easy with 16GB of RAM
  • Equipped with a blazing fast Core i5 2.00 GHz processor.

This cmdlet downloads one file per command. For several files, put the call in a loop.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Method 2: curl.exe

Windows includes a curl executable, and it is useful if you already know curl’s syntax. The trap is the name. In Windows PowerShell 5.1, curl is a built-in alias for Invoke-WebRequest, and it accepts different parameters. A command such as curl -O therefore will not run as curl. Write curl.exe explicitly to reach the real program.

Rank #3
curl.exe -L -o "$env:USERPROFILEDownloadsfile.zip" 'https://example.com/file.zip'

The -L option tells curl to follow redirects, and -o sets the local filename. Microsoft’s curl on Windows documentation also shows curl.exe -O, which saves the file under the name the server provides. Use -o when you want a specific name. The full option list is in curl’s own documentation, not in the Windows page.

Method 3: Start-BitsTransfer

Background Intelligent Transfer Service (BITS) is the transfer service Windows uses for managed downloads. Start-BitsTransfer creates a BITS transfer job from a source and a destination.

Rank #4
15.6 Inch Laptop Computer, N4020, 4GB DDR4 RAM, 128GB eMMC,with Windows 11
  • EFFORTLESS EVERYDAY PERFORMANCE: Powered by Intel Celeron N4020 processor and Windows 11 Home system, delivering reliable, low-power efficiency for daily tasks like document editing, email, online classes, and web browsing
  • 15.6-INCH FULL HD DISPLAY: Enjoy immersive visuals on the 15.6" FHD (1920x1080) anti-glare screen with micro-edge bezels. Delivers clear details and comfortable viewing for long study sessions, working on spreadsheets, and video playback
  • RESPONSIVE MULTITASKING & STORAGE: Built with 4GB LPDDR4 RAM and 128GB eMMC storage for smooth daily essential use. Expand your storage by up to 1TB via the integrated TF card slot to easily store movies, photos, and working files
  • ADVANCED CONNECTIVITY: Outfitted with 2x Full-Featured Type-C ports for data transfer, fast charging, and dual-monitor output, alongside 2x USB 3.2 Gen1 ports and a 3.5mm audio jack for complete peripheral compatibility
  • LIGHTWEIGHT & SILENT OPERATION: Slim and portable for effortless travel or commuting. Features a 1MP HD webcam for remote meetings, 38Wh battery with 45W Type-C fast charging, and a fanless silent design for peaceful work environments.
Start-BitsTransfer -Source 'https://example.com/file.zip' -Destination "$env:USERPROFILEDownloadsfile.zip"

By default the command waits until the transfer completes or fails, so the prompt stays busy during the download. Microsoft’s Start-BitsTransfer reference describes the cmdlet, its download behavior, and an asynchronous option for running the job in the background. The same reference confirms that BITS can handle multiple files in one job. The documentation does not establish that BITS is faster than the other two methods, so choose it for its job-management features rather than for speed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Which command to choose

Situation Command Points to note
One file, you want a PowerShell-native command Invoke-WebRequest -OutFile Add -UseBasicParsing on updated Windows PowerShell 5.1.
You know curl syntax or want its options curl.exe Always write curl.exe in Windows PowerShell 5.1, because bare curl is an alias there.
Managed transfer, several files, or background job Start-BitsTransfer Runs as a BITS job; the Microsoft reference documents asynchronous mode.

Any of the three can save the file to the same path, so decide based on which tool you are comfortable scripting with and whether you need a managed transfer.

Best Value
Windows 11 Laptop with i3 Processor 15.6" Work Laptop for College Students
  • 【Efficient Performance】 Powered by Intel Core i3 processor (2 cores, 4 threads, up to 3.4GHz) with 12GB RAM and 256GB SSD. Handles multitasking, office software, online classes, and HD video streaming smoothly. Integrated Intel UHD Graphics 620
  • Backlit Keyboard & Complete Package】Comes with a cool backlit keyboard. Comes with awebcam, dual stereo speakers (8Ω/1.0W each), DC charger, and user manual – ready for late-night studying, online classes, video conferencing, and daily productivity
  • 【Vibrant Display】 15.6-inch Full HD (1920x1080) anti-glare screen with 16:9 aspect ratio delivers crisp images and vivid colors – perfect for studying, watching lectures, or entertainment. Thin-bezel design maximizes viewing area
  • 【Fast Connectivity & Expansion】 Equipped with WiFi 6 (802.11ax) and Bluetooth 5.2 for stable, high-speed wireless. Features 3 x USB 3.0, HDMI 2.1, Type-C (supports PD3.0 fast charging), and a TF card slot expandable up to 2TB – easily connect external monitors, mice, drives, or expand storage for all your files
  • 【Long Battery Life & Portable】 Built-in 11.55V 5000mAh/57.75Wh high-capacity battery delivers approximately 7 hours of mixed-use battery life – enough for a full day of classes and assignments. Lightweight at just 1.63kg (3.6 lbs) and 19.5mm thin, plus a compact packing size – easily slips into a backpack for campus, library, or coffee shop
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting

  • Invoke-WebRequest stops with a prompt about script execution in Windows PowerShell 5.1. Add -UseBasicParsing, as described under Method 1.
  • A curl command runs as a PowerShell web request. You are in Windows PowerShell 5.1 and used the bare curl alias. Use curl.exe.
  • The download fails with a certificate or connection error. Confirm the URL is correct and uses HTTPS where the site offers it. Do not turn off certificate validation as a routine fix; if you must, treat that as a separate security decision about the source.
  • The file saved but is an HTML page, not the file you wanted. The URL probably points to a landing page. Find the direct file link on the publisher’s site and run the command again.
  • The destination folder does not exist. Create it first with New-Item -ItemType Directory -Path "$env:USERPROFILEDownloadsTools" -Force, then use that path in -OutFile or -Destination.

Before you run a downloaded script or program

A successful transfer does not establish that a file is safe. Microsoft’s about_Execution_Policies documentation notes that download methods such as curl.exe and Invoke-WebRequest may not mark the file as coming from the Internet Zone, which is the marking that execution policy and some Windows warnings rely on. Obtain scripts and programs only from a publisher you trust, read a script before running it, and check the file against any published checksum the publisher provides.

What these commands cannot do

The Microsoft pages cited here cover basic transfers. They do not show that these commands can pass a login screen, accept a session cookie from a browser, or complete a download that requires clicking through a consent page. If a site needs sign-in or a browser step, use the download method the publisher supports, or an authorized direct link. Similarly, if the server does not expose a direct file URL, no PowerShell command will fetch it in a single step.

PowerShell’s download commands are built into Windows, so no extra module or paid tool is needed for any of the three methods above.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep the Windows PowerShell 5.1 and PowerShell 7 distinction in mind when you share scripts with others. A script that works in one may need the curl.exe or -UseBasicParsing adjustments described here to work in the other.

Quick Recap

Bestseller No. 1
Bestseller No. 2
Dell Latitude 5420 14' FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
Dell Latitude 5420 14" FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
256 GB SSD of storage.; Multitasking is easy with 16GB of RAM; Equipped with a blazing fast Core i5 2.00 GHz processor.
$285.00
Bestseller No. 3
HP 14' HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam, Dale Pink (Renewed)
HP 14" HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam, Dale Pink (Renewed)
14" diagonal, 1366x768 resolution, HD BrightView LED, Glossy NON-TOUCH Display
$245.99

The Bottom Line

“”

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.