PowerShell Studio: Custom Menu Features & GIT template
- Written by David Corrales
- Last Updated: 22 April 2016
- Created: 01 October 2015
- Hits: 3161
For those who aren’t familiar with the custom menu, it is a menu that users can customize to call other tools and processes. The menu’s contents can be determined on a global level or a local folder level. Please refer to the following article for more details on the custom menu feature:
Application vs Commandline
We added an optional [Application] group to the CustomMenu.inf.
Any command in the [Application] group will run without waiting for the process to complete. This is a fire-and-forget trigger for applications that do not provide console output, such as PowerRegEx or Windows Explorer.
If you want to display the console application’s results in the Output panel, use the Commandline group:
Note: [Commandline] is the same as using [Menu].
The [Application] and [Commandline] groups are separated in the custom menu.
We included the ability to add separators to the custom menu, which allows you to visually group commands:
To add a separator, include a line item with a dash for text:
Prompt for Input
You now have the option to prompt for input when triggering a custom menu item.
For example, when committing in GIT, you are required to insert a comment. Now you can use the prompt to enter a unique comment.
To prompt the user, you must use the following macro in your Custom Menu.inf file:
If you wish to include a message then use the following format:
Where Message is the text you wish to display.
If you wish to include a default value then use the following format:
Where Default Value is the text you wish to prefill the prompt dialog’s input line.
Here is a sample prompt that is used to enter a comment for the GIT commit command:
As you can see, macro variables can be used within the prompt’s text.
GIT Custom Menu Template
You can download our sample Custom Menu.inf and use it as a template for your GIT repository folders. Simply copy the Custom Menu.inf into your GIT folder and edit the template to fit your needs. When you open a file in the folder, PowerShell Studio’s custom menu will automatically provide you with the commands you specified.