windows Powershell 配色方案?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/50611733/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 20:04:05  来源:igfitidea点击:

Powershell Color Schemes?

windowspowershell

提问by wheeeee

Is there a place where I can find Powershell Color Schemes that people have already built? Something like https://github.com/lysyi3m/osx-terminal-themes, but for Windows Powershell instead of OSX.

有没有地方可以找到人们已经构建的 Powershell 配色方案?类似于https://github.com/lysyi3m/osx-terminal-themes,但适用于 Windows Powershell 而不是 OSX。

I did find this one: https://github.com/Segaso/MonokaiTheme, but I'm confused as to where I find this "Tools". When I right click on the top of any PowerShell window, all I see is this:

我确实找到了这个:https: //github.com/Segaso/MonokaiTheme,但我对在哪里找到这个“工具”感到困惑。当我右键单击任何 PowerShell 窗口的顶部时,我看到的是:

enter image description here

在此处输入图片说明

And this is all I see under properties:

这就是我在属性下看到的所有内容:

enter image description here

在此处输入图片说明

回答by

Microsoft itself released last year Windows Console Colortool

微软自己去年发布了Windows Console Colortool

It works with/modifes the palette of any console app (cmd/Powershell/WSL-bash).

它适用于/修改任何控制台应用程序(cmd/Powershell/WSL-bash)的调色板。

The colortool will work with any .itermcolors scheme.

colortool 将适用于任何 .itermcolors 方案。

download from github

从github下载

enter image description here

在此处输入图片说明

回答by Mustkeem K

Its easy. You can run these commands in powershell. This is custom made color scheme.

这很简单。您可以在 powershell 中运行这些命令。这是定制的配色方案。

$Host.UI.RawUI.BackgroundColor = ($bckgrnd = 'Black')
$Host.UI.RawUI.ForegroundColor = 'White'
$Host.PrivateData.ErrorForegroundColor = 'DarkRed'
$Host.PrivateData.ErrorBackgroundColor = $bckgrnd
$Host.PrivateData.WarningForegroundColor = 'Yellow'
$Host.PrivateData.WarningBackgroundColor = $bckgrnd
$Host.PrivateData.DebugForegroundColor = 'Yellow'
$Host.PrivateData.DebugBackgroundColor = $bckgrnd
$Host.PrivateData.VerboseForegroundColor = 'Green'
$Host.PrivateData.VerboseBackgroundColor = $bckgrnd
$Host.PrivateData.ProgressForegroundColor = 'Blue'
$Host.PrivateData.ProgressBackgroundColor = $bckgrnd
Clear-Host

If you want to have your own scheme you can choose colors as you wish.

如果您想拥有自己的方案,您可以根据需要选择颜色。

Run

get-help write-host

You will get all colors available for powershell.

您将获得可用于 powershell 的所有颜色。

回答by as - if

I use this for the color scheme.it has solarized-darktheme. Make sure you backup your current preset with concfg export console-backup.jsononce you have installed scoopand concfg. For more use this link https://github.com/lukesampson/concfg

我用这个作为配色方案solarized-dark。它有主题。确保 concfg export console-backup.json在安装scoopconcfg. 更多使用此链接https://github.com/lukesampson/concfg

回答by Frédéric Bonneau

You will find this in ISE Powershell

您会在 ISE Powershell 中找到它

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明