Using Windows PowerShell, how do I change the command prompt?
For example, the default prompt says
PS C:\Documents and Settings\govendes\My Documents>
I want to customize that string.
To create the best command-line experience, PowerShell is now the command shell for File Explorer. It replaces Command Prompt (cmd.exe) in the Windows Logo Key + X menu, in File Explorer's File menu, and in the context menu that appears when you shift-right-click the whitespace in File Explorer.
Just put the function prompt
in your PowerShell profile (notepad $PROFILE
), e.g.:
function prompt {"PS: $(get-date)>"}
or colored:
function prompt { Write-Host ("PS " + $(get-date) +">") -nonewline -foregroundcolor White return " " }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With