In this quick tip, I’m going to show you a way to organize and quickly access special symbols in PowerShell.
You might know that you can access a characters ASCII value by the following command
By using this command we are getting the ASCII value of the ‘%’ character. But there are more ASCII characters, or symbols, than we have easy access to through the keyboard. The way to access these symbols are like this
This command will display a note symbol.
If you have a small collection of these symbols you would like to have within easy reach, just collect them all in an object, and add it to your PowerShell profile for ease of access. I have created a starter object for you that you can start with if you want.
Using this object, you can try out the following commands to see how it works
Write-Host "Done with task #1 $($symbols.CHECKMARK)" Write-Host "CompanyName$($symbols.TRADEMARK) $($symbols.COPYRIGHT) 2015"
Please note though, that the available ASCII symbols varies between character sets (fonts). So if you use a specific font, and use characters that are unique to that font, your colleague will probably not see that symbol unless he/she is using the same font as you.