Windows PowerShell: changing the command prompt

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 " "
}

Leave a Comment