PowerShell Scripts, Tips, Expert Advices, Forums, and Resources

Geek Sync Live

Welcome to PowerShell.com, the educational and community site for Windows PowerShell People. Get a quick overview.

As a Powershell.com member you will have access to:

  • Daily PowerShell tips written by Microsoft MVPs and other leading Windows PowerShell experts
  • Free Windows PowerShell advice and training provided by Microsoft MVPs and other leading Windows PowerShell experts
  • Access to leading Windows PowerShell blogs
  • A free ebook, Mastering PowerShell, written by Microsoft MVP Dr. Tobias Weltner
PowerTip of the Day

Using Green Checkmarks in Console Output

In a previous tip you have seen that the PowerShell console supports all characters available in a TrueType font. You just need to convert the character code to the type "Char".

Here is a more advanced example that uses splatting to insert a green checkmark into your console output:

$greenCheck = @{
  Object = [Char]8730
  ForegroundColor = 'Green'
  NoNewLine = $true

Write-Host "Status check... " -NoNewline
Start-Sleep -Seconds 1
Write-Host @greenCheck
Write-Host " (Done)"

So whenever you need a green checkmark, use this line:

Write-Host @greenCheck 

If the checkmark does not appear, make sure your console font is set to a TrueType font like "Consolas". You can set the console font by clicking the icon in the top left corner of the console title bar, then choose "Properties".

Twitter This Tip! ReTweet this Tip!

Copyright 2012 PowerShell.com. All rights reserved.