filmov
tv
Permanent aliases in PowerShell with parameters!

Показать описание
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
#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
Комментарии