Wednesday, March 22, 2023

Setting PowerShell Aliases Permanently in Windows Terminal

In this post let's see how we can set up PowerShell Aliases permanently in Windows Terminal. First, we need to find out the profile we are on. You can do it by running the $PROFILE command.

$PROFILE
And then we need to edit the profile and add the alias using the Set-Alias command. In my case, I wanted to alias k for kubectl.
Set-Alias -Name k -Value kubectl
My PowerShell profile looks like this.
Edut PowerShell Profile
And that's about it. Now all the aliases we set up are available whenever we open up a new terminal/tab.

Hope this helps.

Regards,
Jaliya

No comments:

Post a Comment