【发布时间】:2016-12-05 15:18:16
【问题描述】:
【问题讨论】:
-
Set-PSReadlineOption -TokenKind Command -ForegroundColor Black -
@PetSerAl 请将其发布为答案,它已解决问题。
标签: powershell
【问题讨论】:
Set-PSReadlineOption -TokenKind Command -ForegroundColor Black
标签: powershell
或者更好的是,使用[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。
【讨论】:
Using these settings you can alter your profile so that everytime you launch Powershell they are applied. 请检查我的答案和其中的链接。