ISE Addons, PowerShell, Scripting
comments 15

PowerShell ISE addon menu generator

This is yet another ISE addon I have been using for quite sometime. I polished it a bit so that I can share it here with you all. This addon lets you create addon menu items easily. Without this, I used to open up my ISE profile script and add the menu items manually myself. This is how the addon looks:

ISE Menu Creator

ISE Menu Creator

Here is the script behind this addon.

I used WinForms (shame on me, I did not use WPF) for the GUI. If you want to use this, this is what you need to do:

  1. Copy the contents of above script to a .ps1 file
  2. Dot source this .ps1 in your profile script for ISE
  3. Add the following code to the next line

Once you are done, close and re-open ISE. This is what you will find in the addons menu:

Menu

Menu

Now, you can add menu items using the GUI.

New Menu

New Menu

The “Script block” textbox supports Return and Tab keys. So, you can align the script block as you wish. Finally, if you select the “Add to ISE Profile Script” checkbox, the menu item will be added to you ISE profile script ($profile). This is how it looks.

ISE Profile Script

ISE Profile Script

As far as error checking is concerned, I am making sure that the menu item with the same name does not exist. However, I am not checking for duplicate shortcut keys. Also, there are a few more features I can think of.

  1. Add the ability to edit an existing menu item
  2. Add the ability to add menu item as a submenu
  3. Add the ability to remove a menu item

I will try and add these features in my free time.

Hope you find this useful.

Filed under: ISE Addons, PowerShell, Scripting

by

Ravikanth is a principal engineer and the lead architect for Microsoft and VMware virtualized and hybrid cloud solutions within the Infrastructure Solutions Group at Dell EMC. He is a multi-year recipient of Microsoft Most Valuable Professional (MVP) award in Windows PowerShell (CDM) and Microsoft Azure. Ravikanth is the author of Windows PowerShell Desired State Configuration Revealed (Apress) and leads Bangalore PowerShell and Bangalore IT Pro user groups. He can be seen speaking regularly at local user group events and conferences in India and abroad.