PowerShell

Characters and Emojis in PowerShell

Once something funny, or rather something that has nothing to do with the typical PowerShell things. The retrieval of characters in PowerShell. Let’s jump in.

Retrieving Characters in PowerShell

For showing all (or almost all) characters run the following code. The example gets 15.000 characters.

# Showing Unicode 16-bit character

for ($i=0; $i -lt 15000;$i++) {

   "Char $i : $([char]$i)"
    
}

To show only one of them run the command below.

[char]9996 

Want more fun? Get Emoji Characters …

[char]::ConvertFromUtf32(0x1F4A9)
[char]::ConvertFromUtf32(0x1F601)

Cool stuff.

Grab more here:

https://unicode.org/emoji/charts/full-emoji-list.html

Categories: PowerShell

Tagged as: ,

7 replies »

  1. Patrick, it was a version issue. I had not updated for some time.I performed an update and opened in VS Code; it works perfectly.

    Like

  2. PAtrick, thanks for sharing this bit of code. However it does not show the emoji characters for me, just a generic question mark inside a box for each of them. Is there a graphics package that must be loaded in Powershell in order to display them properly?

    Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.