【问题标题】:How to change the color of power shell editor, for typed commands?如何为键入的命令更改 powershell 编辑器的颜色?
【发布时间】:2016-12-05 15:18:16
【问题描述】:

当我在 powershell 中键入一些命令时,它会变成黄色,这对我来说不是很明显,我该如何更改该颜色?

【问题讨论】:

标签: powershell


【解决方案1】:

或者更好的是,使用[console]::ForegroundColor = "Black"。此外,还有其他选项,例如:

C:\WINDOWS\system32> $host.privatedata

ErrorForegroundColor    : Red
ErrorBackgroundColor    : Black
WarningForegroundColor  : Yellow
WarningBackgroundColor  : Black
DebugForegroundColor    : Yellow
DebugBackgroundColor    : Black
VerboseForegroundColor  : Yellow
VerboseBackgroundColor  : Black
ProgressForegroundColor : Yellow
ProgressBackgroundColor : DarkCyan

C:\WINDOWS\system32> $host.ui.RawUI

ForegroundColor       : Green
BackgroundColor       : Black
CursorPosition        : 0,64
WindowPosition        : 0,18
CursorSize            : 25
BufferSize            : 120,3000
WindowSize            : 120,50
MaxWindowSize         : 120,88
MaxPhysicalWindowSize : 265,88
KeyAvailable          : False
WindowTitle           : Administrator: Windows PowerShell

使用这些设置,您可以更改您的配置文件,以便每次启动 Powershell 时都会应用它们。更多关于this

【讨论】:

  • 我运行了你的命令,但在重新启动 powershell 后它再次显示黄色。
  • 因为您需要更改您的个人资料才能解决此问题,Using these settings you can alter your profile so that everytime you launch Powershell they are applied. 请检查我的答案和其中的链接。
猜你喜欢
  • 1970-01-01
  • 2013-04-22
  • 2014-11-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-06-24
  • 2016-09-18
相关资源
最近更新 更多