Last active
August 29, 2015 13:58
-
-
Save sayedihashimi/10012601 to your computer and use it in GitHub Desktop.
Powershell display message in all foreground colors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Display-MessageInForegroundColors { | |
| [cmdletbinding()] | |
| param( | |
| [Parameter(Mandatory=$true,ValueFromPipeline=$true)] | |
| $message | |
| ) | |
| process{ | |
| [enum]::getvalues([type]'ConsoleColor') | ForEach-Object{ | |
| $curForeground = $_ | |
| '{0}: {1}' -f $message,$curForeground | Write-Host -ForegroundColor $curForeground | |
| } | |
| } | |
| } | |
| 'select options and press enter' | Display-MessageInForegroundColors |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment