Created
May 13, 2016 16:22
-
-
Save gerane/16294a7b5b7abd0f3c1444407d36a018 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Module -Name Emojis | |
function Invoke-Emoji { | |
$context = $psEditor.GetEditorContext() | |
$EmojiText = $context.CurrentFile.GetTextLines($context.SelectedRange) | |
$Emoji = Get-Emoji -Name $EmojiText | |
if ($Emoji) | |
{ | |
$context.CurrentFile.InsertText($Emoji, $context.SelectedRange) | |
} | |
} | |
Register-EditorCommand ` | |
-Name "MyModule.Invoke-Emoji" ` | |
-DisplayName "Replace selected text with emoji" ` | |
-Function Invoke-Emoji | |
"Turn airplane into and emoji: airplane" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment