How can I reset the powershell colors

后端 未结 10 1262
梦毁少年i
梦毁少年i 2021-01-30 20:08

I changed the colors of the powershell and now I can\'t change the color of the input text, is always yellow.

I changed the color of the background and

10条回答
  •  有刺的猬
    2021-01-30 20:38

    I realize this is an old question, but I found it in Google and have another solution.

    Set-PSReadlineOption -TokenKind Command -ForegroundColor Black
    

    Source

    This will change the input text to black. The available color choices are as follows:

    • Black
    • DarkBlue
    • DarkGreen
    • DarkCyan
    • DarkRed
    • DarkMagent
    • DarkYellow
    • Gray
    • DarkGray
    • Blue
    • Green
    • Cyan
    • Red
    • Magenta
    • Yellow
    • White

    You can make this persist by adding it to your profile. It's enough to append the command to the end of the file.

    In my case the profile is in: C:\Users\Billy\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

    To get the location of your PS profile type:

    $profile
    

    If this file doesn't exist, you can create it with:

    New-item –type file –force $profile
    

    (source)

    To see the current settings in your profile, use:

    Get-PSReadlineOption
    

    (source)

提交回复
热议问题