简体   繁体   English

如何使用PowerShell更改VS Package Manager控制台的前景色?

[英]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控制台通常支持的颜色。

Modify Powershell Management Console in Visual Studio 在Visual Studio中修改Powershell管理控制台

在此输入图像描述

您将在标准控制台中使用的属性( $host.PrivateData.ErrorForeGroundColor and $host.PrivateData.ErrorBackGroundColor )在包管理器控制台中不可用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 程序包管理器控制台上的PowerShell版本 - PowerShell Version on Package Manager Console 如何确定在Powershell的Visual Studio程序包管理器控制台中选择的默认项目? - How do I determine the default project selected in the Visual Studio Package Manager Console in Powershell? NuGet与Package Manager控制台 - NuGet vs Package Manager Console 如何在VS NuGet Package Manager控制台中永久设置新的Default项目? - How do I permanently set a new Default project in the VS NuGet Package Manager console? 如何在 Visual Studio 外使用包管理器控制台 powershell - How to use Package Manager Console powershell outside visual studio 如何在 Visual Studio 中配置包管理器控制台使用的 powershell 版本? - how to configure the powershell version used by the package manager console in visual studio? NuGet包管理器控制台无法加载PowerShell - NuGet Package Manager Console unable to load PowerShell 如何在Visual Studio中更改程序包管理器控制台的字体大小 - How to change Font Size of Package Manager Console in Visual Studio 在扩展中以编程方式访问visual studio的powershell控制台(包管理器控制台) - Access the powershell console (package manager console) of visual studio programmatically in an extension Nuget Package Manager控制台中有关PowerShell绑定的奇怪错误 - Strange errors in Nuget Package Manager Console about PowerShell bindings
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM