r/PowerShell • • Mar 15 '16

¯\_(ツ)_/¯

function Get-AsciiShrug {
    $OutputEncoding = [System.Text.Encoding]::unicode
    write-output "¯_($(0x30C4|%{[char]$_}))_/¯" | clip
}
144 Upvotes

48 comments sorted by

View all comments

3

u/tehjimmeh Mar 16 '16 edited Mar 16 '16

If you save the file as UTF8 (default ISE encoding, AFAIK), you can just do:

function Get-AsciiShrug {
    $OutputEncoding = [Text.Encoding]::utf8
    "¯_(ツ)_/¯" | clip
}

In ConEmu with the UTF8 codepage (chcp 65001) and Consolas font, the face displays. Not in the command prompt though (weird, seems like it should work there too).

Also, it's amusing how "ASCII" has gained a colloquial meaning of "non-standard characters". This example is very much not ASCII :)

1

u/sup3rmark Mar 16 '16

Haha I was wondering how long it would take for someone to comment on "ASCII." You're right.