суббота, 12 июня 2010 г.

Make life brighter – color your Powershell

Many of those who prefer to use powershell in their job do not like its original colors. I am among them. Well, that’s not a problem at all – because you can personalize your powershell interface – for convenience, usability and just aesthetics.

I prefer to enable the coloring by writing a simple function within the powershell profile:

# Prompt

function prompt
{
$_locationStackDepthString = New-Object string ([char] '+'), (Get-Location -Stack).Count
$color = 'Cyan'
Write-Host '>> ' -nonewline -ForegroundColor $color
Write-Host $(Get-Date -Format T) -ForegroundColor 'DarkYellow' -NoNewLine
Write-Host " " $PWD.Path -ForegroundColor 'Green'
Write-Host ($_locationStackDepthString + '>') -nonewline -ForegroundColor $color
$host.UI.RawUI.WindowTitle = "POWERSHELL"
return " "
}

This is how I prefer to see my powershell window.

You can use any other combination of colors. If you decide to do so – you might want to start your way from here.

Also available in russian.

Комментариев нет:

Отправить комментарий