Any quick way to call a directory using an environment variable in Powershell

command lineenvironment-variablespowershellpowershell-2.0

Say I have a user environment variable named p and it's value is the path where I store my projects.

In Command Prompt you can use them to quickly access a particular directory from anywhere on the command line:

cd %p%

This doesn't work in Powershell, is there anyway to get the same functionality?

Best Answer

Environment variables have their own provider:

cd $env:p