{"id":9982,"date":"2015-10-01T08:00:08","date_gmt":"2015-10-01T15:00:08","guid":{"rendered":"https:\/\/www.sapien.com\/blog\/?p=9982"},"modified":"2016-05-04T16:27:27","modified_gmt":"2016-05-04T23:27:27","slug":"powershell-studio-2015-new-custom-menu-features-git-template","status":"publish","type":"post","link":"https:\/\/dev.sapien.com\/blog\/2015\/10\/01\/powershell-studio-2015-new-custom-menu-features-git-template\/","title":{"rendered":"PowerShell Studio 2015 &ndash; New Custom Menu Features &amp; GIT template"},"content":{"rendered":"<p>We are continuing to cover the new features introduced in the latest service build of PowerShell Studio 2015 (v4.2.95). In this article we will cover the new additions to PowerShell Studio&#8217;s custom menu.<\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2015\/10\/image391.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border: 0px;\" title=\"image\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2015\/10\/image39_thumb1.png\" alt=\"image\" width=\"644\" height=\"75\" border=\"0\" \/><\/a><\/p>\n<p>For those who aren\u2019t familiar with the custom menu, it is a menu that users can customize to call other tools and processes. The menu\u2019s 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:<\/p>\n<p><a title=\"https:\/\/www.sapien.com\/blog\/2013\/01\/08\/powershell-studio-2012-with-git-subversion-and-mercurial-oh-my\/\" href=\"https:\/\/www.sapien.com\/blog\/2013\/01\/08\/powershell-studio-2012-with-git-subversion-and-mercurial-oh-my\/\">https:\/\/www.sapien.com\/blog\/2013\/01\/08\/powershell-studio-2012-with-git-subversion-and-mercurial-oh-my\/<\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Application vs Commandline<\/strong><\/p>\n<p>We added an optional [Application] group to the CustomMenu.inf.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"Application group\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2015\/09\/image47.png\" alt=\"Application group\" width=\"424\" height=\"52\" border=\"0\" \/><\/p>\n<p>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.<\/p>\n<p>&nbsp;<\/p>\n<p>If you want to display the console application\u2019s results in the Output panel, use the Commandline group:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"Commandline group\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2015\/09\/image48.png\" alt=\"Commandline group\" width=\"580\" height=\"39\" border=\"0\" \/><\/p>\n<p>Note: [Commandline] is the same as using [Menu].<\/p>\n<p>The [Application] and [Commandline] groups are separated in the custom menu.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Menu Separators<\/strong><\/p>\n<p>We included the ability to add separators to the custom menu, which allows you to visually group commands:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border: 0px;\" title=\"Custom Menu with separators\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2015\/10\/image3.png\" alt=\"Custom Menu with separators\" width=\"426\" height=\"291\" border=\"0\" \/><\/p>\n<p>To add a separator, include a line item with a dash for text:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"Add a separator\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2015\/09\/image50.png\" alt=\"Add a separator\" width=\"574\" height=\"59\" border=\"0\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Prompt for Input<\/strong><\/p>\n<p>You now have the option to prompt for input when triggering a custom menu item.<\/p>\n<p>For example, when committing in GIT, you are required to insert a comment. Now you can use the prompt to enter a unique comment.<\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2015\/10\/SNAGHTML4e39890.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border: 0px;\" title=\"Prompt\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2015\/10\/SNAGHTML4e39890_thumb.png\" alt=\"Prompt\" width=\"244\" height=\"76\" border=\"0\" \/><\/a><\/p>\n<p>To prompt the user, you must use the following macro in your Custom Menu.inf file:<\/p>\n<p>{Prompt}<\/p>\n<p>If you wish to include a message then use the following format:<\/p>\n<p>{Prompt|Message}<\/p>\n<p>Where <em>Message<\/em> is the text you wish to display.<\/p>\n<p>If you wish to include a default value then use the following format:<\/p>\n<p>{Prompt|Message|Default Value}<\/p>\n<p>Where <em>Default Value<\/em> is the text you wish to prefill the prompt dialog\u2019s input line.<\/p>\n<p>Here is a sample prompt that is used to enter a comment for the GIT commit command:<\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2015\/10\/image33.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border: 0px;\" title=\"Using a prompt\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2015\/10\/image33_thumb.png\" alt=\"Using a prompt\" width=\"644\" height=\"33\" border=\"0\" \/><\/a><\/p>\n<p>As you can see, macro variables can be used within the prompt\u2019s text.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>GIT Custom Menu Template<\/strong><\/p>\n<p>You can download our sample <a href=\"https:\/\/www.sapien.com\/downloads#Blog%20Samples\/CustomMenu%20GIT%20Template.zip\">Custom Menu.inf<\/a> 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\u2019s custom menu will automatically provide you with the commands you specified.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are continuing to cover the new features introduced in the latest service build of PowerShell Studio 2015 (v4.2.95). In this article we will cover the new additions to PowerShell Studio&#8217;s custom menu. For those who aren\u2019t familiar with the custom menu, it is a menu that users can customize to call other tools and [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[703,632,25],"tags":[1031,786,28,951,1032,141],"class_list":["post-9982","post","type-post","status-publish","format-standard","hentry","category-powershell-studio","category-whats-new-software-news","category-windows-powershell","tag-custom-menu","tag-git","tag-powershell","tag-powershell-studio-2015","tag-template","tag-whats-new"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/9982","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/comments?post=9982"}],"version-history":[{"count":10,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/9982\/revisions"}],"predecessor-version":[{"id":11915,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/9982\/revisions\/11915"}],"wp:attachment":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/media?parent=9982"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/categories?post=9982"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/tags?post=9982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}