How to change text color between two quotes in Pow

2019-06-14 13:48发布

问题:

I can't change the text color between two quotes (now its color is durk-blue). Where can I set up this setting or which command I have to execute?

sample

回答1:

PSReadline v1.x (as shipped with Windows PowerShell v5.1):

Set-PSReadlineOption -TokenKind String -ForegroundColor Green

PSReadline v2.x (as shipped with PowerShell Core 6.1.0):

Set-PSReadLineOption -Colors @{ String = 'Green' }

In both cases you can use the colors defined in the [ConsoleColor] enumeration type.

In v2.x you can alternatively use Virtual Terminal escape sequences.

See Get-Help Set-PSReadlineOption