How to use PowerShell alias cd a spec directory?

前端 未结 2 612
猫巷女王i
猫巷女王i 2021-01-11 13:29

On Linux

alias cdt=\'cd /usr/a\'

make a alias that when I type

cdt

I change the workpath to /use/a

<
2条回答
  •  攒了一身酷
    2021-01-11 14:03

    To make sure this stays as a permanent alias you can do the following in powershell:

    notepad $profile
    

    and paste the following in the file (at the end):

    function gotoa { set-location "F:\a" }
    new-alias cdt gotoa
    

提交回复
热议问题