{"id":13761,"date":"2017-07-20T08:00:28","date_gmt":"2017-07-20T15:00:28","guid":{"rendered":"https:\/\/www.sapien.com\/blog\/?p=13761"},"modified":"2017-07-20T07:50:31","modified_gmt":"2017-07-20T14:50:31","slug":"powershell-studio-2017-service-release-v5-4-142","status":"publish","type":"post","link":"https:\/\/dev.sapien.com\/blog\/2017\/07\/20\/powershell-studio-2017-service-release-v5-4-142\/","title":{"rendered":"PowerShell Studio 2017: Service Release v5.4.142"},"content":{"rendered":"<p>Today we released a new service build of PowerShell Studio 2017 (v5.4.142).<\/p>\n<p>In this service build we introduced new packager engines, new project features and made improvements to PowerShell Studio\u2019s PrimalSense.<\/p>\n<p>&nbsp;<\/p>\n<h2>New Features<\/h2>\n<h2><\/h2>\n<h3>New Packager Engines<\/h3>\n<p>PowerShell Studio now includes three new packager engines that add more diversity to your existing scripts:<\/p>\n<table class=\"nicetable\" border=\"0\" width=\"559\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"174\">Windows Application<\/td>\n<td valign=\"top\" width=\"383\">Displays the script\u2019s output in a Windows UI.<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"174\">Windows Service<\/td>\n<td valign=\"top\" width=\"383\">Runs your script as a Windows service.<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"174\">Windows AppTray<\/td>\n<td valign=\"top\" width=\"383\">Displays a tray icon while the script runs.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>Refer to the following articles for more details on the new engines:<\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/2017\/06\/14\/new-script-engines-for-windows-powershell\/\">https:\/\/www.sapien.com\/blog\/2017\/06\/14\/new-script-engines-for-windows-powershell\/<\/a><\/p>\n<p><a title=\"https:\/\/www.sapien.com\/blog\/2017\/07\/10\/creating-a-system-tray-application-with-powershell\/\" href=\"https:\/\/www.sapien.com\/blog\/2017\/07\/10\/creating-a-system-tray-application-with-powershell\/\">https:\/\/www.sapien.com\/blog\/2017\/07\/10\/creating-a-system-tray-application-with-powershell\/<\/a><\/p>\n<p><a title=\"https:\/\/www.sapien.com\/blog\/2017\/07\/12\/write-a-windows-service-in-powershell\/\" href=\"https:\/\/www.sapien.com\/blog\/2017\/07\/12\/write-a-windows-service-in-powershell\/\">https:\/\/www.sapien.com\/blog\/2017\/07\/12\/write-a-windows-service-in-powershell\/<\/a><\/p>\n<p>&nbsp;<\/p>\n<h3>Projects \u2013 Synchronizing Files and Folders<\/h3>\n<p>We added two new project properties that will allow you to synchronize your project files and folders when the project is loaded. The new properties are located in the <em>Synchronization<\/em> group of the project properties. To edit the properties, select the project node in the <strong>Projects<\/strong> panel, then use the <strong>Properties<\/strong> pane to modify the project properties.<\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2017\/07\/image-10.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2017\/07\/image_thumb-10.png\" alt=\"image\" width=\"304\" height=\"347\" border=\"0\" \/><\/a><\/p>\n<h4>Synchronized<\/h4>\n<p>When enabled, this setting synchronizes the project files and folders. When the project is loaded, PowerShell Studio will automatically add new files and remove any missing files.<\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2017\/07\/Dynamic-Project-Sync.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"Dynamic Project Sync\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2017\/07\/Dynamic-Project-Sync_thumb.png\" alt=\"Dynamic Project Sync\" width=\"644\" height=\"351\" border=\"0\" \/><\/a><\/p>\n<h4>File Filter<\/h4>\n<p>This file filter determines which files to search for when synchronizing the project files. Edit this property to customize the files that are included in the synchronization.<\/p>\n<p>File Filter Formatting:<\/p>\n<blockquote><p><em>*.extension1;*.extenion2<\/em><\/p><\/blockquote>\n<p>Each extension filter needs to be separated by a semi-colon. For example, you can include images by appending the following filters:<\/p>\n<blockquote><p><em>*.jpg; *.png;<\/em><\/p><\/blockquote>\n<p>The default filter includes all PowerShell file extensions.<\/p>\n<p>&nbsp;<\/p>\n<h3>Project Snippets<\/h3>\n<p>PowerShell Studio now allows users to include project specific snippets. A project snippet folder will appear in the <strong>Snippet<\/strong> pane whenever you open a project.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"Project Snippets\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2017\/07\/Project-Snippets.png\" alt=\"Project Snippets\" width=\"240\" height=\"378\" border=\"0\" \/><\/p>\n<p>Project snippets take precedence over user and preset snippets.<\/p>\n<h4>Adding Project Snippets<\/h4>\n<p>To add a snippet to the project, simply create or copy the snippet to the project\u2019s directory and PowerShell Studio will automatically display it in the <strong>Snippets<\/strong> pane when you open the project.<\/p>\n<p>Note: You <b>do not<\/b> need to add the snippet to the project itself using the <strong>Project<\/strong> pane.<\/p>\n<p>&nbsp;<\/p>\n<h4>Copying Project Snippets<\/h4>\n<p>You can copy snippets to and from the project by simply dragging the snippet within the <strong>Snippets<\/strong> panel.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"Drag &amp; Drop Snippets\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2017\/07\/Drag-Drop-Snippets.png\" alt=\"Drag &amp; Drop Snippets\" width=\"240\" height=\"378\" border=\"0\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3>Improved PrimalSense for Dynamic Objects and Properties<\/h3>\n<p>We made some improvements to PowerShell Studio\u2019s PrimalSense in this service release. PowerShell Studio will now be able to provide PrimalSense for dynamic objects and properties, such as custom PSObject with note properties.<\/p>\n<pre lang=\"powershell\">$writer = [pscustomobject]@{ Name = 'David'; Last = 'Corrales' }<\/pre>\n<p>&nbsp;<\/p>\n<h4>Why didn\u2019t it do this before?<\/h4>\n<p>For two reasons:<\/p>\n<ol>\n<li>PowerShell Studio resets the PowerShell runspace on every execution.<\/li>\n<li>Because the runspace is hosted in a separate process, the editor was not able to provide PrimalSense for custom objects.<\/li>\n<\/ol>\n<p>Thankfully we were able to address this problem in by using the stored session state information. Now let\u2019s look at how you can use a session state to provide PrimalSense for variables.<\/p>\n<p>&nbsp;<\/p>\n<h4>How to store the session state for PrimalSense<\/h4>\n<p>1. Set a breakpoint in your script. It is important to choose the right location, because it determines the state of the session variables at that given point.<\/p>\n<p>2. Start the debugger (F5). When the debugger hits a breakpoint, it will store the variable session state and display them in the <strong>Variables<\/strong> pane:<\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2017\/07\/Breakpoint-Variables-Pane.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"Breakpoint Variables Pane\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2017\/07\/Breakpoint-Variables-Pane_thumb.png\" alt=\"Breakpoint Variables Pane\" width=\"644\" height=\"351\" border=\"0\" \/><\/a><\/p>\n<p>Notice that the note properties are displayed in the <strong>Variables<\/strong> pane:<\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2017\/07\/NoteProperties-Variables-Panel.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"NoteProperties Variables Panel\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2017\/07\/NoteProperties-Variables-Panel_thumb.png\" alt=\"NoteProperties Variables Panel\" width=\"644\" height=\"130\" border=\"0\" \/><\/a><\/p>\n<p>3. Exit the debugger. PowerShell Studio will use the session state of the last break in order to provide PrimalSense for variables:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"PrimalSense\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2017\/07\/PrimalSense.png\" alt=\"PrimalSense\" width=\"610\" height=\"202\" border=\"0\" \/><\/p>\n<p>As you can see, the note properties now appear in the PrimalSense list.<\/p>\n<p>&nbsp;<\/p>\n<h4>Clearing the Session State<\/h4>\n<p>If you wish to revert the PrimalSense session state, you can do this by using the <strong>Clear Session Variables<\/strong> command in the <strong>Variables<\/strong> pane\u2019s context menu:<\/p>\n<p><a href=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2017\/07\/Variable-Pane-Clear-Session-Variables.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"Variable Pane - Clear Session Variables\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2017\/07\/Variable-Pane-Clear-Session-Variables_thumb.png\" alt=\"Variable Pane - Clear Session Variables\" width=\"644\" height=\"197\" border=\"0\" \/><\/a><\/p>\n<p>Alternatively, you can use the editor\u2019s context menu:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"Clear Session Variables\" src=\"https:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2017\/07\/Clear-Session-Variables.png\" alt=\"Clear Session Variables\" width=\"437\" height=\"357\" border=\"0\" \/><\/p>\n<p><strong>Clear Session Variables<\/strong> command is only enabled when the debugger has stopped.<\/p>\n<p>&nbsp;<\/p>\n<p>We hope these new features improve your overall experience with PowerShell Studio. 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","protected":false},"excerpt":{"rendered":"<p>Today we released a new service build of PowerShell Studio 2017 (v5.4.142). In this service build we introduced new packager engines, new project features and made improvements to PowerShell Studio\u2019s PrimalSense. &nbsp; New Features New Packager Engines PowerShell Studio now includes three new packager engines that add more diversity to your existing scripts: Windows Application [&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,632],"tags":[28,1188,645,155],"class_list":["post-13761","post","type-post","status-publish","format-standard","hentry","category-powershell-studio","category-service-build","category-software-news","category-whats-new-software-news","tag-powershell","tag-powershell-studio-2017","tag-service-build-2","tag-service-release"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/13761","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=13761"}],"version-history":[{"count":5,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/13761\/revisions"}],"predecessor-version":[{"id":13767,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/13761\/revisions\/13767"}],"wp:attachment":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/media?parent=13761"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/categories?post=13761"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/tags?post=13761"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}