PowerGUI - Take control of the script editor
In his PowerShell Editor Roundup: PowerGUI Pro blog post, Don mentions that PowerGUI's script editor lacks the ability to resolve 'alias-to-cmdlet'. Luckily we don't have to wait for next releases of PowerGUI or submit feature requests to have that functionality available. Starting with the latest product release, PowerGUI 2.1, we now have the option to extend the Script Editor with our own solutions using the new Script Editor SDK!
The Editor SDK allows us to create Add-Ons, add and remove menus and menu items, toolbar buttons, and a lot more. In this post I'm going to create a new toolbar, place a button in it and attach to it a code snippet (adapted from MVP Doug Finke) to make that missing feature available.
Download and expand Expand-Alias.zip, copy the icon file to your C drive and load the script (MyToolbar.ps1) into the script editor. Press F5 to execute it.
A new Toolbar is added with the Expand-Alias button in it.
Write some code with aliases in the Code pane
Now click the button or press CTRL+E to invoke the Expand-Alias command.
Awesome!
Some links to resources I've used:
PowerGUI 2.1 Quick tips on YouTube:
Create custom HTML pages inside your PowerPacks.
Create chart templates to graphically display your powershell results.