Summary: Use Windows PowerShell to display a message in 16 colors.
How can I use Windows PowerShell to easily display a message in 16 different colors to start my presentation
with something a little different?
Use the range operator to create 16 numbers. Pipe the numbers to the Foreach-Object cmdlet. In the
script block, use Write-Host, and specify the foreground color as the number.
Here is the command (using aliases for conciseness):
0..15 | %{write-host -f $_ 'hi'}
0 comments