Let's take the powershell command Write-Host "red text" -Fore red
this displays "red text" in a foreground of red.
But, you want the text to be displayed in a slightly lighter
font color, light red.
Is there a way to do this and get any foreground color (and background) in the RGB spectrum using powershell?
See this: https://github.com/PoshCode/Pansies
It is a PowerShell module that does this.
There is an issue here related to your question:
https://github.com/PowerShell/PowerShell/issues/14588
Please click the above link for more information.
$PSVersionTable.PSVersion
Major Minor Patch PreReleaseLabel BuildLabel
----- ----- ----- --------------- ----------
7 1 0
(0..256).ForEach{write-host "`e[38;5;$($_)m[$_]"} # background color
(0..256).ForEach{write-host "`e[48;5;$($_)m[$_]"} # Foreground color
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With