More Integrated Scripting Environment Customization
December 29, 2008 at 7:12 AM
—
Andy Schneider
You can add custom menus using $PSISE in the PowerShell Integrated Scripting Environment. Quite simply, you create a custom menu, assign it a scriptblock, and a keyboard shortcut. For example, lets say you wanted Ctrl-D to always run the dir (get-childitem) command.
You can use the CustomMenu class like so.
1: $psIse.CustomMenu.Submenus.Add("_Dir", {dir}, "Ctrl+D")
In addition to the keyboard shortcut, you also get a menu as well.
Now when you hit Ctrl-D, it will run the dir command. All kinds of cool things are available within the editor with the new object model.
2932fbd5-699f-4771-8040-187f915e1c97|0|.0
Posted in:
Tags: