sexta-feira, 25 de novembro de 2011

Personalizing PowerShell Prompt

On PowerShell type:

> notepad $profile

Write on notepad:

function prompt
{
 $base = "[$($pwd.Drive):] {0}> "
 if ("$pwd".EndsWith('\'))
 {
  $base -f '\'
 }
 elseif ("$pwd" -eq $env:UserProfile)
 {
  $base -f '~'
 }
 else
 {
  $base -f "$pwd".Substring("$pwd".LastIndexOf('\') + 1)
 }
 (Get-Host).UI.RawUI.WindowTitle = $pwd
}

Nenhum comentário:

Postar um comentário