Run this in powershell:
start notepad $profile
This will open your profile in notepad (notepad will prompt you to create it if it does not exist).
Any code that you write in this .ps1 file will run when powershell starts.
You can also set the system environment variable as if you set MYPSPATH to C:\Users\Username\Dropbox\Websites\2014\Projects , then you could do this:
cd $env:MYPSPATH
This can be done manually either every time or automatically in your $profile .
Also not clear from your question, but it looks like you are doing cd for each component of the path.
There is no need to do this. This command you like:
cd C:\Users\Username\Dropbox\Websites\2014\Projects\ProjectName
will work as is. If I misunderstood this moment, I apologize.
Something that may also be useful to you is pushd , which is an alias of Push-Location . This allows you to switch to a new directory and easily go back to where you started with popd or Pop-Location .
PS C:\users\Xenostar> Push-Location .\Dropox\Websites\2014\Projects PS C:\users\Xenostar\Dropbox\Websites\2014\Projects> Pop-Location PS C:\users\Xenostar>
And you can repeatedly press several levels and continue to return to the previous ones.
briantist
source share