If you would like to make error messages more readable, you can change their background color from black to white:
$host.PrivateData.ErrorBackgroundColor = ‘White’
Use this line to see the colors that you can assign:
[System.Enum]::GetNames([System.ConsoleColor])
To use a transparent error background color, you should assign the current console background color:
$host.PrivateData.ErrorBackgroundColor = $host.UI.RawUI.BackgroundColor