Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable syntax highlight on Windows 10 PowerShell?

I want to disable syntax highlight on windows 10 power shell.

How I can do it?
There is no menu to disable it on preference.

Note that I using windows 10 (Anniversary updated)

like image 619
KiYugadgeter Avatar asked Feb 06 '23 05:02

KiYugadgeter


1 Answers

As by default syntax highlighting provided by PSReadline module, then you need to remove PSReadline module from your PowerShell session:

Remove-Module PSReadline

or, if you want to use other PSReadline features (like persistent history) you can configure syntax highlighting to use same color for all kinds of tokens:

[Microsoft.PowerShell.TokenClassification].GetEnumValues() | % { 
    $DefaultColor = (Get-PSReadlineOption).DefaultTokenForegroundColor
} {
    Set-PSReadlineOption -TokenKind $_ -ForegroundColor $DefaultColor
}
like image 136
user4003407 Avatar answered Feb 16 '23 06:02

user4003407