Using Green Checkmarks in Console Output

by | May 22,2015

Table of Contents

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”.

Advanced Example: Using Splatting for Console Output

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 

Ensuring Checkmark Visibility

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”.
ReTweet this Tip!