I like to define the env variable PROMPT as $p$_$g so prompt starts in a new line.
But seems to be not applying to my PowerShell prompt 🙁
dir function:/ shows that a name "prompt" is already defined.
Any way I can get my prompt customized in a PowerShell console, without messing up with the already defined "prompt" name?
Best Answer
The
prompt
function is just the default prompt supplied by Powershell. If you put a newprompt
function into your profile, it will overwrite the existing one - but if you remove the custom definition in your profile, the previous function will be used again.Edit your profile with:
Then add your custom
prompt
function:Restart powershell and you will have your new prompt.
To revert, just edit
$profile
again and remove the new function.