На досуге развлекался переделкой PowerShell чтобы он был похож на Linux’овский bash 😉 Вот что получилось…
Вставляем следующий код в $PROFILE:

cd $env:userprofile

function prompt
{
    $homedir=$env:userprofile;
    $m=$homedir.length;
    $str = $pwd.Path;
    if ($str -eq $homedir)
    {
        $str="~";
    }
    else
    {
        if ($str.length -ge $m)
        {
            if ($str.substring(0,$m) -eq $homedir)
            {
                $str="~"+$str.substring($m);
            }
        }
    }

    Write-Host -NoNewline -ForeGroundColor Cyan "PS ";

    if ($env:username -eq "Администратор")
    {
        Write-Host -NoNewline -ForeGroundColor Gray "$env:computername:";
    }
    else
    {
        Write-Host -NoNewline -ForeGroundColor Gray "$env:username@$env:computername:";
    }   
    Write-Host -NoNewline -ForeGroundColor DarkYellow "$str";
    if ($env:username -eq "Администратор")
    {
        Write-Host -NoNewLine -ForeGroundColor Cyan " #";
    }
    else
    {
        Write-Host -NoNewLine -ForeGroundColor Cyan ">";
    }
    " "
}

Получаем результат:

Новый рисунок (2)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: