我在Windows 10上使用PowerShell。虽然我已经能够调整背景和大部分前景色,

我似乎不知道如何关闭语法高亮显示或更改颜色

这个设置在哪里?
发布于 2022-07-13 15:05:06
动态语法突出显示来自Windows 10中随PSReadLine module附带的PowerShell。
您可以将所有令牌颜色“重置”到控制台主机应用程序使用的任何颜色:
# Prepare a dictionary to hold all the new token-color mappings
$colorMap = @{}
# Fetch the possible coloring options
Get-PSReadLineOption |Get-Member *Color -MemberType Property |ForEach-Object {
# Add a mapping to our dictionary that overrides the existing setting with whatever foreground color is used by the console
$colorMap[$_.Name -replace 'Color$'] = [Console]::ForegroundColor
}
# Use the dictionary to update the highlighting settings
Set-PSReadLineOption -Colors $colorMaphttps://stackoverflow.com/questions/72968361
复制相似问题