Is there a way to get Powershell to inherit the cmd prompt

cmd.exepowershellwindowswindows 7

In the cmd shell, it is possible to set (and save) the prompt using the PROMPT command et al. However, when you go into Powershell from cmd, it reverts to the default windows prompt – usually the current directory.

Is there a way to force Powershell to use the current windows prompt?

Best Answer

Got this working thanks to the very useful comments. Just in case someone else hits the same issue:

$profile

Yields the location of where the Powershell profile exists (or would exist). If it doesn't exist, the following command would create it:

new-item -itemtype file -path $profile -force

In here, we can just write a prompt function. I generally set mine to the current user so:

function prompt {"PS: $(echo 'RobbieDee')>"}
Related Question