Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Powershell alias for "cd .."

I want to create an alias for cd .. as .. in powershell.

I've tried to following variations but to no avail.

Set-Alias ".." "cd .."
Set-Alias ".." { set-location "cd .." }
Set-Alias ".." { set-location ".." }
like image 895
h-rai Avatar asked Dec 17 '25 19:12

h-rai


1 Answers

It would have to be a function, since it has arguments:

function .. { set-location .. }

There's actually a function already called "cd.." with no spaces, to mimic cmd. So you could also do:

set-alias .. cd..
like image 165
js2010 Avatar answered Dec 20 '25 09:12

js2010



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!