change powershell command color

12,871

Solution 1

Regarding @LotPings answer, I solved my issue. The following command in powershell changed the command color from yellow to green:

Set-PSReadLineOption -colors @{ Command = "Green"}

Solution 2

You can also set an environment variable in the terminal settings:

IntelliJ terminal settings

Then edit your powershell profile and add something like this:

if ($env:CommandColor) {
    Set-PSReadLineOption -colors @{ Command = $env:CommandColor}
}

Solution 3

Visite this Link to know how to change PowerShell command color.

Also, You can use Ohmyz for customizing your PowerShell also they have some awesome plugins and themes

Share:
12,871
wero026
Author by

wero026

Updated on June 25, 2022

Comments

  • wero026
    wero026 about 2 years

    How do I change the command color in powershell? Currently it is yellow and when I use powershell nested in Intellij, I can't read the yellow command on white background.

    powershell command color

  • wero026
    wero026 about 5 years
    And which entry I have to change? I tried $host.UI.RawUI.ForegroundColor, but the ugly yellow still remains
  • Antu
    Antu about 5 years
    I'm on Linux right now so I cannot help you about that appropriate $host name but you may try Ohmyz and also it have greate thems
  • L. F.
    L. F. about 5 years
    It would be nice if you add some explanation along with your code.
  • LordWilmore
    LordWilmore about 5 years
    Whilst this solution may work, it is always useful to add some commentary explaining your answer and which part in particular resolves the original stated problem.