Setting Powershell colors with hex values in profile script

前端 未结 5 1420
旧时难觅i
旧时难觅i 2021-01-11 17:09

I know I can change PowerShell console colors by setting in my profile something like:

$Host.UI.RawUI.BackgroundColor = \"White\"
Clear-Host
<
5条回答
  •  花落未央
    2021-01-11 17:53

    As far as I know, you can't. The console API doesn't support custom color. If you do this:

    $x = (Get-Host).UI.RawUI
    $x | gm
    

    you'll see that BackgroundColor is of type System.ConsoleColor.

提交回复
热议问题