I just want PowerShell to be black text on a white background. However, PowerShell v5 highlights my commands and makes them yellow, which is impossible to see. Is there a way to turn off ALL syntax highlighting in PowerShell?
Syntax coloring in PowerShell v5 can be modified via Set-PSReadlineOption
. The following command sets the foregound and background color for comments to the shell foreground and background color:
Set-PSReadlineOption -TokenKind Comment -ForegroundColor $Host.UI.RawUI.ForegroundColor -BackgroundColor $Host.UI.RawUI.BackgroundColor
or just black and white:
Set-PSReadlineOption -TokenKind Comment -ForegroundColor Black -BackgroundColor White
You need to do this for all TokenKind
values to remove syntax coloring entirely.
If you also want to change output stream colors you can do that via the properties of the host's PrivateData
object:
$Host.PrivateData.WarningForegroundColor = $Host.UI.RawUI.ForegroundColor
$Host.PrivateData.WarningBackgroundColor = $Host.UI.RawUI.BackgroundColor
...
Put all of these statements into your profile to get them applied every time you start PowerShell, e.g.:
$HOME\Documents\WindowsPowerShell\profile.ps1