-
-
Notifications
You must be signed in to change notification settings - Fork 1
TIPS: Run the script as a command from everywhere
Well, it is not really from everywhere but from every default terminal session
In case you want to call the yt-download.ps1 not from the browser using the user script but from a terminal, it is not very user friendly if you have to run it using its full path every time like:
& 'path\to\yt-download.ps1' -url "https://some-url"Once your script is “installed” and won’t move…
Here is the way to do it.
Open the Windows Terminal and set your powershell 7 profile as default.
Open a new powershell 7 tab.
If you have VS Code installed, run
Code $Profileelse run
notepad $Profile
or use any editor you want to edit your pwsh profile with.
Now your pwsh profile should be open in an editor. Add this line and save the file.
Set-Alias -Name 'yt' -Value (Get-Item "$env:OneDrive\Documents\ytdl\yt-download.ps1").FullName -Description 'UserAlias: call "$env:OneDrive\Documents\ytdl\yt-download.ps1"'Replace $env:OneDrive\Documents\ytdl\yt-download.ps1 with the actual path where you put the yt-download.ps1 script.
Open a new pwsh tab or run . $Profile in the current tab to reload the profile in the current pwsh session.
Now you can use yt alias in any pwsh session instead of & 'path\to\Set random Wallpaper.ps1'
yt -url "https://some-url"- (Optional but recommended) Install a Nerd Font
- Using Windows Terminal
- (Optional but recommended) Install UniGetUI
- Install Powershell 7
- Allow Powershell scripts to run
-
Install
yt-dlpandffmpegcommands on your OS globally - Install Tampermonkey on your browser
- 🛠️ Configuration: yt-download.ps1
- 🚀 Usage via Terminal
- 🌐 Browser Integration (Userscript)
- TIPS: Run the script as a command from everywhere