PowerShell – Change Error Text And Warning Text Colors

0
39

How could such a nice tool have such a terrible choice of colors for errors and warnings? I am talking about the ISE and the unreadable contrast of colors.

You can fix it. Open and update your profile by running this from your ISE (which opens your profile in NotePad)
notepad $profile

# Change the color of error and warning text
# -------------------------------------------
$opt = (Get-Host).PrivateData
$opt.WarningBackgroundColor = "Orange"
$opt.WarningForegroundColor = "white"
$opt.ErrorBackgroundColor = "red"
$opt.ErrorForegroundColor = "white"

Add the above to your profile. Save. Your ISE will have better colors for errors and warnings going forward (after a restart). For it to take effect immediately, just run it.

As a matter of fact, this is the color combination I have been using for a while and I cringe every time I see the default error/warning colors.

These colors are much better for Error and Warning

SHARE
Previous articleHow To Install CentOS 7
Next articlePowerShell – Comparing Two Arrays
mm
Hi, I’m Ravinder Jaiswal. I’m the person behind this website. Thank you for visiting the website! My website is all about Microsoft, VMware, Red Hat, Citrix and other technologies. I have 14+ years of IT experience. I am AZURE, MCSA 2016, MCSE 2016, RHCSA 7, RHCE 7, VCP-DCV 6.5, VCP-DTM 6.1, ITILv3 certified.