{"id":10264,"date":"2015-11-10T08:00:05","date_gmt":"2015-11-10T16:00:05","guid":{"rendered":"https:\/\/www.sapien.com\/blog\/?p=10264"},"modified":"2015-11-10T08:32:07","modified_gmt":"2015-11-10T16:32:07","slug":"powershell-studio-2015-service-release-v4-2-96","status":"publish","type":"post","link":"https:\/\/dev.sapien.com\/blog\/2015\/11\/10\/powershell-studio-2015-service-release-v4-2-96\/","title":{"rendered":"PowerShell Studio 2015: Service Release v4.2.96"},"content":{"rendered":"<p>We released a new service build for PowerShell Studio 2015 (v4.2.96).<\/p>\n<p>&nbsp;<\/p>\n<p>In this release we introduced another new feature:<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Create Module from Help<\/strong><\/p>\n<p>If you aren\u2019t familiar with PowerShell HelpWriter, it is a tool that lets you create external PowerShell help files (MAML) for existing modules or from scratch. PowerShell HelpWriter can be a useful design tool for creating modules, by allowing you to plan out your module\u2019s cmdlets and its parameter sets before writing a single line of PowerShell code.<\/p>\n<p>This write-help-first design approach is made much easier with PowerShell Studio\u2019s<em> Create Module from Help File<\/em> feature.<\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2015\/11\/image.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2015\/11\/image_thumb.png\" width=\"226\" height=\"244\"><\/a><\/p>\n<p>Create a new project and select the help file and give your module a name:<\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2015\/11\/SNAGHTML108e6ab.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"SNAGHTML108e6ab\" style=\"border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px\" border=\"0\" alt=\"SNAGHTML108e6ab\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2015\/11\/SNAGHTML108e6ab_thumb.png\" width=\"244\" height=\"82\"><\/a><\/p>\n<p>Now you have a new module containing the help file and the skeleton functions defined in the help file.<\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2015\/11\/image1.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2015\/11\/image_thumb1.png\" width=\"244\" height=\"151\"><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Build Button for Module Projects<\/strong><\/p>\n<p>We added a build button to the Project Panel for module projects.<\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2015\/11\/image2.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2015\/11\/image_thumb2.png\" width=\"150\" height=\"244\"><\/a><\/p>\n<p>The build button will build the module and export the module to:<\/p>\n<p>My Documents\\WindowsPowerShell\\Modules<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Improved Syntax Coloring for Classes<\/strong><\/p>\n<p>We improved syntax coloring for classes. Enumerator and class types are now colored.<\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2015\/11\/image3.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2015\/11\/image_thumb3.png\" width=\"244\" height=\"179\"><\/a><\/p>\n<p><strong>Support for New Operator<\/strong><\/p>\n<p>We also added PrimalSense support for .NET types and the New operator that was introduced in PowerShell V5.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2015\/11\/image4.png\" width=\"829\" height=\"123\"><\/p>\n<p><strong>Improved Theme<\/strong><\/p>\n<p>We improved the theme coloring of the panels and buttons (especially for those who like the dark theme):<\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2015\/11\/image5.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2015\/11\/image_thumb4.png\" width=\"244\" height=\"151\"><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Packager Engine Parameters Update<\/strong><\/p>\n<p>We made some changes to the packager engines so that it is easier for you to handle parameters. Now when you have a parameter block in your script, you can pass named parameters to the executable and it will pass the values to the script for you.<\/p>\n<p>For example, if your script has a parameter block such as:<\/p>\n<pre><span style=\"color: #0000ff\">  param<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #8b0000\">$param1<\/span> <span style=\"color: #00008b\">=<\/span> <span style=\"color: #ff0000\">'default'<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #00008b\">[<\/span><span style=\"color: #0f5186\">int<\/span><span style=\"color: #00008b\">]<\/span><span style=\"color: #8b0000\">$param2<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #00008b\">[<\/span><span style=\"color: #0f5186\">int<\/span><span style=\"color: #00008b\">]<\/span><span style=\"color: #8b0000\">$param3<\/span><span style=\"color: #000000\">)<\/span><\/pre>\n<p>You can call the packaged executable using named parameters:<\/p>\n<pre><span style=\"font-weight: bold; color: #0000ff\">  packaged.exe<\/span> <span style=\"color: #648cc8; font-style: italic\">\u2013Param1<\/span> <span style=\"color: #ff0000\">\"value 1\"<\/span> <span style=\"color: #648cc8; font-style: italic\">\u2013Param2<\/span> <span style=\"color: #4b0082\">2 <span style=\"color: #648cc8; font-style: italic\">\u2013Param3<\/span> <span style=\"color: #5a0032\">1<\/span><\/span><\/pre>\n<p>Now there are a few caveats:<\/p>\n<p>1. Arguments\/ Parameters passed to the executable are going to be strings and not the original objects. Luckily PowerShell can convert strings to integers and other types behind the curtains.<\/p>\n<p>2. You can\u2019t pass an array of values:<\/p>\n<pre><span style=\"color: #648cc8; font-style: italic\">       -Param1<\/span> <span style=\"color: #5a0032\">1<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #5a0032\">2<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #4b0082\">3<\/span><\/pre>\n<p>Instead you will have to convert it to a string and process the values in your script.<\/p>\n<pre><span style=\"color: #648cc8; font-style: italic\">       -Param1<\/span> <span style=\"color: #ff0000\">\"1, 2, 3\"<\/span><\/pre>\n<p>Then to have to split the value:<\/p>\n<pre><span style=\"color: #8b0000\">       $param1<\/span> <span style=\"color: #00008b\">\u2013split<\/span> <span style=\"color: #ff0000\">','<\/span><\/pre>\n<p>3. You can\u2019t use switch or Boolean parameters. Instead you will have to use a parameter of type <em>int<\/em> or <em>string<\/em> and check for specific values<\/p>\n<p>&nbsp;<\/p>\n<p>We also added a new variable <span style=\"color: #800000\">$EngineArgs<\/span> (<em>string[]<\/em>) which contains the arguments passed to the executable.<\/p>\n<p>For example, if you pass the following arguments to the packaged executable:<\/p>\n<pre><span style=\"font-weight: bold; color: #0000ff\">  packaged.exe<\/span> <span style=\"color: #648cc8; font-style: italic\">\u2013Param1<\/span> <span style=\"color: #5a0032\">value1<\/span> <span style=\"color: #648cc8; font-style: italic\">\u2013Param2<\/span> <span style=\"color: #ff0000\">\"value 2\"<\/span> <span style=\"color: #648cc8; font-style: italic\">\u2013Param3<\/span> <span style=\"color: #5a0032\">1<\/span><\/pre>\n<p>The <span style=\"color: #800000\">$EngineArgs<\/span> variable will contain:<\/p>\n<p>-Param1<br \/>value1<br \/>-Param2<br \/>value 2<br \/>-Param3<br \/>1<\/p>\n<p>You can use the <span style=\"color: #800000\">$EngineArgs<\/span> variable if you wish to process the packager arguments manually. The <span style=\"color: #800000\">$EngineArgs<\/span> variable makes for a better alternative than using the <span style=\"color: #800000\">$Commandline<\/span> variable, which you would have to parse from scratch.<\/p>\n<p>In an upcoming article we will cover using parameters in packaged executables in more detail.<\/p>\n<p>&nbsp;<\/p>\n<p>Please continue providing your feedback. Many of the new features included in the service builds are suggestions from users like you. Therefore if you have any suggestions or feature requests, please share them with us on our <a href=\"https:\/\/www.sapien.com\/forums\/viewforum.php?f=9\">Wish List and Feature Requests<\/a> forum.<\/p>\n<p>&nbsp;<\/p>\n<p><em>UPDATE: v4.2.97 Corrects a coloring issue with the designer.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We released a new service build for PowerShell Studio 2015 (v4.2.96). &nbsp; In this release we introduced another new feature: &nbsp; Create Module from Help If you aren\u2019t familiar with PowerShell HelpWriter, it is a tool that lets you create external PowerShell help files (MAML) for existing modules or from scratch. PowerShell HelpWriter can be [&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,624,21,25],"tags":[28,951,645,155],"class_list":["post-10264","post","type-post","status-publish","format-standard","hentry","category-powershell-studio","category-service-build","category-software-news","category-windows-powershell","tag-powershell","tag-powershell-studio-2015","tag-service-build-2","tag-service-release"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/10264","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=10264"}],"version-history":[{"count":6,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/10264\/revisions"}],"predecessor-version":[{"id":10294,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/10264\/revisions\/10294"}],"wp:attachment":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/media?parent=10264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/categories?post=10264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/tags?post=10264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}