ISEMenuItemCollection은 ISEMenuItem 개체의 컬렉션이며 Microsoft.PowerShell.Host.ISE.ISEMenuItemCollection 클래스의 인스턴스입니다. Windows PowerShell ISE(통합 스크립팅 환경)에서 메뉴를 사용자 지정하는 데 사용되는 $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus 개체를 예로 들 수 있습니다.
메서드
Add(string displayName, System.Management.Automation.ScriptBlock action, System.Windows.Input.KeyGesture shortcut)
메뉴 항목을 컬렉션에 추가합니다.
- displayname
- 추가할 메뉴의 표시 이름입니다.
- action
- 이 메뉴 항목에 연결된 작업을 지정하는 System.Management.Automation.ScriptBlock입니다.
- shortcut
- 작업에 대한 바로 가기이며 System.Windows.Input.KeyGesture 유형입니다.
- 결과:
- 방금 추가된 ISEMenuItem을 반환합니다.
# 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")
참고 항목