Skip to content

Instantly share code, notes, and snippets.

@gerane
Last active April 27, 2017 03:56
Show Gist options
  • Save gerane/e56382c61b83d3b06a2da75597471bef to your computer and use it in GitHub Desktop.
Save gerane/e56382c61b83d3b06a2da75597471bef to your computer and use it in GitHub Desktop.
Register-EditorCommand `
-Name "Demo.Editors" `
-DisplayName "Editors Demo" `
-SuppressOutput `
-ScriptBlock {
param([Microsoft.PowerShell.EditorServices.Extensions.EditorContext]$context)
$SelectedText = $Context.CurrentFile.GetText($context.SelectedRange)
New-TestFromText -Text $SelectedText
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment