изменить цвет команды powershell - PullRequest
1 голос
/ 20 мая 2019

Как мне изменить цвет команды в powershell?В настоящее время он желтый, и когда я использую PowerShell, вложенный в Intellij, я не могу прочитать желтую команду на белом фоне.

powershell command color

Ответы [ 3 ]

1 голос
/ 20 мая 2019

См. Командлеты Get-PSReadlineOption и Set-PSReadlineOption

Вы можете изменить:

Set-PSReadlineOption -Tokenkind Command -BackgroundColor Black

Или просмотреть текущие настройки:

> Get-PSReadlineOption

EditMode                               : Windows
ContinuationPrompt                     : >>
ContinuationPromptForegroundColor      : DarkYellow
ContinuationPromptBackgroundColor      : DarkMagenta
ExtraPromptLineCount                   : 0
AddToHistoryHandler                    :
CommandValidationHandler               :
CommandsToValidateScriptBlockArguments : {ForEach-Object, %, Invoke-Command, icm...}
HistoryNoDuplicates                    : False
MaximumHistoryCount                    : 4096
MaximumKillRingCount                   : 10
HistorySearchCursorMovesToEnd          : False
ShowToolTips                           : False
DingTone                               : 1221
CompletionQueryItems                   : 100
WordDelimiters                         : ;:,.[]{}()/\|^&*-=+'"–—―
DingDuration                           : 50
BellStyle                              : Audible
HistorySearchCaseSensitive             : False
ViModeIndicator                        : None
HistorySavePath                        : C:\Users\LotPings\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\Cons
                                         oleHost_history.txt
HistorySaveStyle                       : SaveIncrementally
DefaultTokenForegroundColor            : DarkYellow
CommentForegroundColor                 : DarkGreen
KeywordForegroundColor                 : Green
StringForegroundColor                  : DarkCyan
OperatorForegroundColor                : DarkGray
VariableForegroundColor                : Green
CommandForegroundColor                 : Yellow
ParameterForegroundColor               : DarkGray
TypeForegroundColor                    : Gray
NumberForegroundColor                  : White
MemberForegroundColor                  : White
DefaultTokenBackgroundColor            : DarkMagenta
CommentBackgroundColor                 : DarkMagenta
KeywordBackgroundColor                 : DarkMagenta
StringBackgroundColor                  : DarkMagenta
OperatorBackgroundColor                : DarkMagenta
VariableBackgroundColor                : DarkMagenta
CommandBackgroundColor                 : DarkMagenta
ParameterBackgroundColor               : DarkMagenta
TypeBackgroundColor                    : DarkMagenta
NumberBackgroundColor                  : DarkMagenta
MemberBackgroundColor                  : DarkMagenta
EmphasisForegroundColor                : Cyan
EmphasisBackgroundColor                : DarkMagenta
ErrorForegroundColor                   : Red
ErrorBackgroundColor                   : DarkMagenta
1 голос
/ 20 мая 2019

Посетите эту ссылку , чтобы узнать, как изменить цвет команды PowerShell.

Кроме того, вы можете использовать Ohmyz для настройки вашей PowerShell, также у них есть несколько удивительных плагины и темы

0 голосов
/ 20 мая 2019

Что касается ответа @LotPings, я решил свою проблему.Следующая команда в powershell изменила цвет команды с желтого на зеленый:

Set-PSReadLineOption -colors @{ Command = "Green"}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...