[英]How do you change the foreground color of the VS Package Manager Console with PowerShell?
Using PowerShell, how do I change the foreground font color in the Visual Studio Package Manager Console? 使用PowerShell,如何在Visual Studio包管理器控制台中更改前景字体颜色?
When an error occurs, the foreground color turns white, and the background turns red, so it seems possible to modify the color. 发生错误时,前景色变为白色,背景变为红色,因此似乎可以修改颜色。
I want to modify the color to highlight a certain status of my return results, so I need to be able to programmatically change the color with PowerShell. 我想修改颜色以突出显示返回结果的某个状态,因此我需要能够以编程方式使用PowerShell更改颜色。
After I change the color and use it, I want to return the color to the default. 更改颜色并使用后,我想将颜色恢复为默认颜色。 (much like the existing error formatting works)
(很像现有的错误格式化工作)
Certain colors are customizable, but you can't use the standard $host
properties. 某些颜色是可自定义的,但您不能使用标准的
$host
属性。 To customize VS powershell text colors, you can you Tools->Options->Environment->Font and Colors and modify the Plain Text
option Item foreground
. 要自定义VS powershell文本颜色,可以使用工具 - >选项 - >环境 - >字体和颜色,然后修改
Plain Text
选项Item foreground
。 See example below... 见下面的例子......
However, there doesn't seem to be options anywhere to control the error/warning/debug/verbose/progress colors specifically as is typically supported with other powershell consoles . 但是,似乎没有任何地方可以选择控制错误/警告/调试/详细/进度颜色,这是其他PowerShell控制台通常支持的颜色。
您将在标准控制台中使用的属性( $host.PrivateData.ErrorForeGroundColor and $host.PrivateData.ErrorBackGroundColor
)在包管理器控制台中不可用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.