How to use PowerShell alias cd a spec directory?

岁酱吖の 提交于 2019-12-03 18:10:55

问题


On Linux

alias cdt='cd /usr/a'

make a alias that when I type

cdt

I change the workpath to /use/a

On PowerShell

Set-Alias cdt "cd F://a"

It seems not work


回答1:


Aliases can't use parameters, so define a function instead.

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


来源:https://stackoverflow.com/questions/29716361/how-to-use-powershell-alias-cd-a-spec-directory

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!