r/PowerShell • u/sup3rmark • Mar 15 '16
¯\_(ツ)_/¯
function Get-AsciiShrug {
$OutputEncoding = [System.Text.Encoding]::unicode
write-output "¯_($(0x30C4|%{[char]$_}))_/¯" | clip
}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.
2
u/StratoLion Mar 15 '16
I can't get this to work. How should I use it from Powershell ISE?
2
u/sup3rmark Mar 15 '16
i just added it to my powershell profile. do you have one of those set up? or some other module that you manually import all the time?
2
5
u/gangstanthony Mar 15 '16
clip automatically puts it into the clipboard. you will see no output on the powershell console when this is run. just run the function then do ctrl+v to see the clipboard contents.
2
u/StratoLion Mar 15 '16
OMFG THIS IS AMAZING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2
u/GoGoGadgetWhiskey Mar 16 '16
I learned the pipe-to-clip trick watching those MS powershell video tutorials. It works in the regular command prompt as well! :)
I do this a lot:
C:\> systeminfo |clip C:\> notepadand... paste
→ More replies (2)1
u/freddyquell Mar 15 '16
Not sure what 'clip' does but removing that makes it work for me in the ISE.
2
u/sup3rmark Mar 15 '16
removing clip kind of renders this even more useless than it already is, though.
that said... ¯_(ツ)_/¯
3
u/da_chicken Mar 15 '16
PS C:\> where.exe clip C:\Windows\System32\clip.exe PS C:\> clip /? CLIP Description: Redirects output of command line tools to the Windows clipboard. This text output can then be pasted into other programs. Parameter List: /? Displays this help message. Examples: DIR | CLIP Places a copy of the current directory listing into the Windows clipboard. CLIP < README.TXT Places a copy of the text from readme.txt on to the Windows clipboard.1
0
Mar 15 '16
[deleted]
2
u/omrsafetyo Mar 15 '16
Write-Host "Loading..." Write-Host "Loading..." Write-Host "Loading..." Get-Shruggie→ More replies (1)
2
u/OpiumPhrogg Mar 15 '16
For any of you android users, the app "Look of Disapproval" has a TON of ascii guys shrugging, flipping tables, etc..
https://play.google.com/store/apps/details?id=com.slaughter.look.of.disapproval&hl=en
1
u/sup3rmark Mar 15 '16
i use this one: https://play.google.com/store/apps/details?id=com.codebutler.shrug&hl=en (it only has ¯_(ツ)_/¯)
1
u/Whitestrake Mar 16 '16
This is amazing. I can swap between it and the Google keyboard with the little globe button. Perfect.
¯_(ツ)_/¯
18
5
u/Brekkjern Mar 15 '16
You should expand this to include the table flip and other emoji since you seem to be into over engineering things :P
5
4
4
u/pohatu Mar 15 '16
Damn I miss powershell. I wonder how far along the osx compatible one is. Maybe I should help out with that project. Powershell is the best thing about Windows.
3
u/mister_wizard Mar 15 '16
Oh great, something else to add to my profile that i dont actually need! (Thanks, seriously this is pretty funny)
2
u/aaroniusnsuch Mar 15 '16
try
[string](0..8|%{[char][int]("001750009200095000401248400041000950004700175".Substring(($_*5),5))})-replace " "2
2
u/Darkm27 Mar 16 '16
You gotta make it scale-able man
function Get-AsciiEmoji{
[CmdletBinding()]
param (
[ValidateSet("Shrug","TableFlip")]
[parameter(Mandatory = $false)]
[string]$WhichOne
)
Process{
$OutputEncoding = [System.Text.Encoding]::unicode
[string]$Output
switch($WhichOne){
"TableFlip" { $Output = "(╯°□°)╯︵ ┻━┻" }
"Shrug" { $Output = "¯_($(0x30C4|%{[char]$_}))_/¯" }
}
write-output $Output
}
}1
0
27
u/sup3rmark Mar 15 '16
I got sick of googling "ascii shrug" and copy/pasting from there all the time so i just put this function into my powershell profile.