更改详细默认颜色

mar*_*sze 5 powershell verbose

Powershell 中详细输出(例如Write-Verbose或开关)的默认颜色是黄色。-Verbose这使得它看起来像警告,尽管它并不重要。

如何更改详细输出的默认颜色?

mar*_*sze 3

这可以通过$Host自动变量来实现。

在您的$Profile添加:

$Host.PrivateData.VerboseForegroundColor = 'Cyan'
Run Code Online (Sandbox Code Playgroud)

(您可以使用任何有效的ConsoleColor。)