为路径创建别名 [英] create alias for path
本文介绍了为路径创建别名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在PowerShell中是否可以为路径创建别名?
Is it possible in PowerShell to create alias for path?
例如:
我必须一直写
For example: I have to write all time
PS PS C:\Users\Jacek>cd C:\windows\microsoft.net\framework\v4.0.30319
我会很高兴能写
PS PS C:\Users\Jacek>cd dotNet4path
推荐答案
您可以在Powershell配置文件中创建一个变量,并以该路径作为值。
You could just create a variable in your powershell profile with that path as the value.
然后,您需要做的就是
cd $dotNet4path
要在个人档案配置文件中添加一些内容,请在Powershell窗口中键入$ profile,它将显示您的Powershell档案文件的路径。如果不存在,请创建它。
To add something to your profile profile, type $profile, into a powershell window and it will display the path to your powershell profile file. Create it if it does not exist.
然后将此行放入文件中,保存并重新启动powershell。
Then put this line in the file, save and restart powershell.
$dotNet4path = "C:\windows\microsoft.net\framework\v4.0.30319"
这篇关于为路径创建别名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文