question

Filip-2434 avatar image
0 Votes"
Filip-2434 asked ·

powershell Color

Hello everybody.
How can i change powershell background color with using powershell commands?
Thanks for answare

windows-server-powershell
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AndreasBaumgarten avatar image
0 Votes"
AndreasBaumgarten answered ·
·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Tiu avatar image
0 Votes"
Tiu answered ·

Hi @Filip-2434,

just type the following inside your powershell:
$Host.UI.RawUI.BackgroundColor = 'Black'
You can change Black with all other colors like Green, Red, Blue,...

To change the colors of your letters for example to green, type the following:
$host.ui.RawUI.ForegroundColor ='Green'

To see the changes just clear your console window. These settings are temporary. If you want them to be persistent check, if you have already a profile file (Test-Path $profile). If you don't have a profile, you can create it using following command: New-Item -path $profile -type file -force
Then fill the file with some information like for example
$console = $host.ui.rawui
$console.backgroundcolor = "black"
$console.foregroundcolor = "white"
$colors = $host.privatedata
$colors.verbosebackgroundcolor = "Magenta"
$colors.verboseforegroundcolor = "Green"
$colors.warningbackgroundcolor = "Red"
$colors.warningforegroundcolor = "white"
$colors.ErrorBackgroundColor = "DarkCyan"
$colors.ErrorForegroundColor = "Yellow"
set-location C:\
clear-host

Best regards
Matthias

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.