На досуге развлекался переделкой 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 ">";
}
" "
}
Получаем результат: