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
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
Aliases can't use parameters, so define a function instead.
function cdt { set-location "F:\a" }
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
Edit your PS profile file to add something like following:
(If you need to find the location of your PS profile, type $profile
in PS terminal and it will give you the path to the profile file.)
$work= @{
project = 'C:\folder1\work\project'
webapp = 'C:\folder1\work\project\wars\webapp\src\main\webapp'
components = 'C:\folder1\work\project\components'
build = 'C:\folder1\work\project\build'
}
Restart the Powershell and then you can cd
as following:
cd $work.webapp