https://github.com/seeminglyscience/pseshelperlibrary
https://github.com/seeminglyscience/pseshelperlibrary
editor-helper powershell
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/seeminglyscience/pseshelperlibrary
- Owner: SeeminglyScience
- License: mit
- Created: 2017-03-27T01:44:58.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-02T00:32:57.000Z (over 8 years ago)
- Last Synced: 2025-04-18T21:31:03.561Z (10 months ago)
- Topics: editor-helper, powershell
- Language: PowerShell
- Size: 145 KB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PSESHelperLibrary
The PSESHelperLibrary module provides tools to assist in interacting with PowerShell Editor Services along with some
commands for general editing use.
This project is at a very early stage and does not currently have an official release. But feel free to try it out
and let me know needs to change.
## Features
### PSEditorCommand attribute and Import-EditorCommand
Tag functions as editor commands with the PSEditorCommand attribute. Import them with the Import-EditorCommand
function to automatically add the Context parameter and register them with Editor Services.
```powershell
#requires -Module PSESHelperLibrary
using module PSESHelperLibrary
function Invoke-MyEditorCommand {
[PSEditorCommand(DisplayName='Invoke my editor command')]
[CmdletBinding()]
param()
if ($Context) {
$Context.CurrentFile.InsertText('I am an editor command!')
}
}
Import-EditorCommand -Command Invoke-MyEditorCommand
```
Or import all the editor commands tagged in a module with `Import-EditorCommand -Module MyModule`.
### Expand-MemberExpression
Expand normal member expressions with private members to working reflection statements.

### Expand-Expression
Replace selected text with it's return value.
### Under Construction
More demos for existing features are coming soon, as well as commands and tools for command creators.