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
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:
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)
I found the MS page linked to in one of the above answers worked for me just now, today, june 2019
ms fix for powershell
I simply pasted their first suggestion - this - into powershell and it seems okay now:
Set-PSReadLineOption -Colors @{
#Use a ConsoleColor enum
"Error" = [ConsoleColor]::DarkRed
#24 bit color escape sequence
"String" = "$([char]0x1b)[38;5;100m"
#RGB value
"Command" = "#8181f7"
}
though I'm not 100% sure because the white background I set is still there. But the yellow is gone, that's for sure.
This is a later edit. I've come back and tried to put all that into a code block instead of just the first line but I can't figure out how to do it.
Point is you must put all the code between the curly braces in and the #tagged lines are comments. Unfortunately the comments and code are all on the same line and I can't fix it. The comment finishes where the " " text begins.
Would have been simpler if I'd taken the comments out I guess. Anyway.. June 2019, this is the only technique that worked for me.
p.s. I now find the fix doesn't work after closing down. When I restart I have to do it again.
The colors you see by right clicking on the title bar and clicking on Properties are actually stored in the shortcut file itself in the ExtraData
section. You can just delete shortcut and recreate it, or you can use a hex editor to change the values. Outside of that, there is not "reset" feature. This is also true for the normal command prompt.
This resets the console colors (e.g., [Console]::BackgroundColor): (Paste in the powershell console)
[Console]::ResetColor()
I found this worked. It's the answer from user 577111 I think. We need to put all this into PS.
Set-PSReadLineOption -Colors @{
### Use a ConsoleColor enum
"Error" = [ConsoleColor]::DarkRed
### 24 bit color escape sequence
"String" = "$([char]0x1b)[38;5;100m"
### RGB value
"Command" = "#8181f7" }
Edit: as pointed out by @dhobbs in the comments, this is no longer an option in PowerShell 6: https://docs.microsoft.com/en-us/powershell/module/PSReadline/Set-PSReadlineOption?view=powershell-6.
Resetting the PowerShell console colors to their defaults can be done with the following command:
Set-PSReadlineOption -ResetTokenColors
Documentation here: https://msdn.microsoft.com/en-us/powershell/reference/5.1/psreadline/set-psreadlineoption
Add the line to your PowerShell profile to make it have the command run each time a PowerShell console is opened. To see the location of your PowerShell profile, from a PowerShell console type:
$profile