An ISEMenuItemCollection is a collection of ISEMenuItem objects. It is an instance of the Microsoft.PowerShell.Host.ISE.ISEMenuItemCollection class. An example is the $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus object that is used to customize the menus in the Windows PowerShell Integrated Scripting Environment (ISE).

Method

Add(string displayName, System.Management.Automation.ScriptBlock action, System.Windows.Input.KeyGesture shortcut)

Adds a menu item to the collection

displayname
The display name of the menu to be added.

action
The System.Management.Automation.ScriptBlock that specifies the action associated with this menu item.

shortcut
The shortcut for the action. It is of type System.Windows.Input.KeyGesture.

Returns:
The ISEMenuItem that was just added.

# Create an Add-ons menu with an accessor.
# Note the use of “_”  as opposed to the “&” for mapping to the accelerator for the menu item.
$menuAdded = $psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add("_Process",{get-process},"Alt+P")

See Also




Table Of Contents