How to Install yt‑dp on Windows via PowerShell
If you’ve ever needed to grab a video from YouTube or another streaming site, you’ve probably heard of yt‑dp. It’s a lightweight, open‑source downloader that works much faster than many alternatives. The good news? You don’t need a fancy GUI – a few PowerShell commands get the job done in seconds.
Why Use PowerShell for the Installation?
PowerShell is built into Windows, so there’s no extra software to install. It talks directly to the system, letting you fetch files, set execution policies, and add shortcuts without hopping between menus. Plus, the commands are repeatable – handy if you manage several machines.
Prerequisites
- Windows 10 or later (PowerShell 5.1+)
- Internet connection
- Administrator rights (for the first run only)
That’s really all you need. If you’re on an older build, consider updating PowerShell first; the Install-Module cmdlet works best with the newer version.
Step‑by‑Step Installation
1. Open PowerShell as Administrator
Right‑click the Start button, choose “Windows PowerShell (Admin)”, and confirm the UAC prompt. Running as admin ensures you can write to the C:\Program Files directory later, though you can also install to your user folder if you prefer.
2. Set the Execution Policy
Windows blocks unsigned scripts by default. Temporarily relax the policy with:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy BypassThis change only lasts for the current session – a safe compromise.
3. Download the Latest yt‑dp Binary
Use Invoke-WebRequest to pull the executable from the official GitHub releases:
$url = "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe"$dest = "$HOME\yt-dlp.exe"
Invoke-WebRequest -Uri $url -OutFile $dest
Storing it in your home folder avoids permission hassles. Feel free to change $dest to another path if you like.
4. Verify the Download
A quick version check confirms everything worked:
&$dest --versionYou should see a numeric string like 2024.06.09. If you get an error, double‑check the URL or your internet connection.
5. (Optional) Add yt‑dp to Your PATH
Having the executable on the system PATH means you can call yt-dlp from any folder. Here’s a simple way:
$envPath = [Environment]::GetEnvironmentVariable("Path","User")$newPath = "$HOME"
if (-not $envPath.Contains($newPath)) {
[Environment]::SetEnvironmentVariable("Path",$envPath + ";$newPath","User")
}
Close the PowerShell window and reopen it; now typing yt-dlp works everywhere.
Testing Your New Installation
Pick a video URL you want to download. For example:
yt-dlp https://www.youtube.com/watch?v=dQw4w9WgXcQThe command fetches the best‑quality MP4 by default and saves it in the current directory. You’ll see a progress bar, checksum, and a brief summary at the end.
Keeping yt‑dp Up to Date
Because the tool updates frequently, you’ll want a simple way to refresh the binary:
Invoke-WebRequest -Uri $url -OutFile $dest -ForceRunning this occasional “force” download replaces the old file without any extra steps.
Common Pitfalls and How to Fix Them
- ExecutionPolicy errors: If you receive a “script blocked” message, try setting the policy at the
CurrentUserscope instead ofProcess. - Path not recognized: Ensure you reopened PowerShell after modifying the PATH variable; the change isn’t retroactive.
- Network timeouts: Some corporate firewalls block GitHub. Use a VPN or download the file manually from the releases page, then place it in
$HOME.
Beyond the Basics: Handy PowerShell Aliases
If you find yourself typing yt-dlp a lot, create an alias for brevity:
Set-Alias ytd $destAdd that line to your PowerShell profile ($PROFILE) and you’ll have ytd ready for the next session.
Wrapping Up
Installing yt‑dp via PowerShell is remarkably straightforward once you know the commands. A few lines get you a powerful downloader that runs silently in the background, leaving the heavy lifting to the script itself. Now you can focus on what really matters – choosing the right video to save.