Reputation: 1505
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.
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:
And this is all I see under properties:
Upvotes: 24
Views: 105967
Reputation: 1
I needed "PowerShell syntax colors" changed, but I didn't want to run the ISE. Using a modern system that only had PowerShell 5.x, I had to do the following:
# This shows current settings (including colors for commands, comments, ...)
Get-PSReadLineOption
# Setup a hash table with new colors (cuz that is how it is done)
$ISETheme = @{
Command = "$([char]0x1b)[30m"
Comment = "$([char]0x1b)[30m"
ContinuationPrompt = "$([char]0x1b)[30m"
Default = "$([char]0x1b)[30m"
Emphasis = "$([char]0x1b)[30m"
Error = "$([char]0x1b)[30m"
Keyword = "$([char]0x1b)[30m"
Member = "$([char]0x1b)[30m"
InlinePrediction = "$([char]0x1b)[30m"
ListPrediction = "$([char]0x1b)[30m"
Selection = "$([char]0x1b)[35;43m"
Number = "$([char]0x1b)[30m"
Operator = "$([char]0x1b)[30m"
Parameter = "$([char]0x1b)[30m"
String = "$([char]0x1b)[30m"
Type = "$([char]0x1b)[30m"
Variable = "$([char]0x1b)[30m"
ListPredictionSelected = "$([char]0x1b)[30m"
}
#Change the colors
Set-PSReadLineOption -Colors $ISETheme
Documentation on using Set-PSReadLineOption
Using "FromRGB", IF you have PowerSHell 7.2
To make the change permanent, add it to your PowerShell startup script.
FULL answer on Setup PowerShell $Profile
A Short incomplete answer is to type in PowerShell: notepad $Profile
Above is a monochrome "30=black text" pallet, Below are other colors
Foreground Background
No Color normal bright normal bright
0 black 30 90 40 100
1 red 31 91 41 101
2 green 32 92 42 102
3 yellow 33 93 43 103
4 blue 34 94 44 104
5 violet 35 95 45 105
6 turqoise 36 96 46 106
7 grey 37 97 47 107
good example of using escape sequences in PowerShell
In addition, you may also want to follow posts above from:
Mustkeem K: "$Host.UI.RawUI.BackgroundColor = ...
wheeeee: Original question on setting "Windows Powershell->properties->colors" menu
Upvotes: 0
Reputation: 2710
Tagging on to the response by @user6811411, you could also use the entire Windows Terminal app, which integrates the colour tool and is available from the Microsoft Store. In the app's settings, you can change the colour scheme quite easily.
The colour will only be changed for PowerShell sessions started from within the app, but I find it quite useful to organize all my terminals in one window, so that this was not a big downside for me. I also liked the option to define customized shells.
Upvotes: 1
Reputation: 8768
Its easy. You can run these commands in powershell. This is a custom made color scheme.
$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.
To get the list of the colors. Run below command.
get-help write-host
You will get all colors available for powershell.
Upvotes: 24
Reputation:
Microsoft itself released last year Windows Console Colortool
It works with/modifes the palette of any console app (cmd/Powershell/WSL-bash).
The colortool will work with any .itermcolors scheme.
Upvotes: 25
Reputation: 3297
I use this for the color scheme.it has solarized-dark
theme. Make sure you backup your current preset with
concfg export console-backup.json
once you have installed scoop
and concfg
. For more use this link https://github.com/lukesampson/concfg
Upvotes: 2