Permanent aliases in PowerShell with parameters!

preview_player
Показать описание
In this video we'll go through how to search, add, edit or remove aliases in PowerShell, but also make them permanent by editing the PowerShell profile. We also cover assigning commands with parameters using functions inside the PowerShell profile and assign it to an alias. This will greatly help you quickly run long commands which you need to run often.
#powershell #terminal #windows11 #productivity

Timestamp:
0:00 Intro
0:20 alias intro
0:38 list aliases
0:49 search for an alias
1:35 add alias
2:08 create permanent alias with PowerShell profile
3:06 check availability of an alias
4:02 adding commands with parameters to aliases
4:17 example of function to alias
4:31 export alias list to csv file
4:44 import alias csv file
5:05 remove an alias
5:20 echo into alias

Relevant videos:

Used commands:
alias
alias | findstr -i ls
get-alias -Name ls
Get-Alias -Definition Get-ChildItem
New-Alias -Name list -Value Get-ChildItem
alias | findstr -i list
New-Item $profile -force -itemtype file
alias | findstr -i echo
start $profile
notepad $profile
new-alias -name np -value notepad
Function FunctionName {long-command-with-parameters}
Set-Alias -Name AliasName -Value FunctionName
Remove-Alias -Name np
Del alias:np
Рекомендации по теме
Комментарии
Автор

Thank you for making the "Adding commands with parameters to aliases" at 4:16 part so straightforward.

I have been searching online while you just showed me how to do it in 13 seconds lol.

sir_enuf
Автор

Many thanks. Fantastic tutorial. Exactly what I was after.

paulgriffin
Автор

Amazing video, just what I needed to make some shortcuts and waste less time!

antonispao
Автор

Hi @itvraag great video, any comment why this is not working to me, I have into ssh config file <ssh ubu = to server (ubuntu) with key file>
Function ubuup {ssh ubu; sudo apt update && apt upgrade -y}
Set-Alias -Name ubu -Value ubuup
I reach go into server but update and upgrade do not work.

jmaviles
join shbcf.ru