Skip to content

Instantly share code, notes, and snippets.

@sayedihashimi
Last active August 29, 2015 13:58
Show Gist options
  • Select an option

  • Save sayedihashimi/10012601 to your computer and use it in GitHub Desktop.

Select an option

Save sayedihashimi/10012601 to your computer and use it in GitHub Desktop.
Powershell display message in all foreground colors
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