Add command alias to your PowerShell in just a few minutes!
Imagine you can shorten your "terraform init" to something like "tf init".
Use with caution You may find the alias overlapping other existing commands, so please consider when applying
Find the current profile file (Microsoft.PowerShell_profile.ps1) of PowerShell at "$PSHOME\Microsoft.PowerShell_profile.ps1" AND "$HOME\Documents\PowerShell\Microsoft.PowerShell_profile.ps1"
If exists , open the file, and add your aliases as following:
powershell new-alias -Name tf -Value terraform
new-alias -Name pn -Value pnpm
Add your aliases line by line.
Format: new-alias -Name
-Value Example, if you want to shorten pnpm install to pn install, then the value would be
powershell new-alias -Name pn -Value pnpm
Save the file and restart your PowerShell.
If not exist, consider the method 2 below.
Create a file called "Microsoft.PowerShell_profile.ps1" under your desired folder, but common use is "$HOME\Documents\PowerShell"
Add your aliases config just like method 1 above.
Save and restart your PowerShell.
Type “$HOME” on your PowerShell!