{"id":7129,"date":"2014-04-10T09:00:06","date_gmt":"2014-04-10T17:00:06","guid":{"rendered":"http:\/\/www.sapien.com\/blog\/?p=7129"},"modified":"2014-04-10T09:26:26","modified_gmt":"2014-04-10T17:26:26","slug":"powershell-studio-2014-what-new-in-the-editor","status":"publish","type":"post","link":"https:\/\/dev.sapien.com\/blog\/2014\/04\/10\/powershell-studio-2014-what-new-in-the-editor\/","title":{"rendered":"PowerShell Studio 2014: What New in the Editor?"},"content":{"rendered":"<p>Let\u2019s look at some of the new features you will find in PowerShell Studio 2014\u2019s editor.<\/p>\n<p><strong>Improved Syntax Coloring<\/strong><\/p>\n<p>One of the first editing features you might have noticed in PowerShell Studio 2014 is the improved syntax coloring.<\/p>\n<p><em>Parameter Attributes and Type Coloring:<\/em><\/p>\n<p>PowerShell Studio will now color parameter attributes and types when valid:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"Attribute and Type Coloring\" alt=\"Attribute and Type Coloring\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2014\/03\/AttributeandTypeColoring.png\" width=\"499\" height=\"220\" border=\"0\" \/><\/p>\n<p><em>External Tools Coloring:<\/em><\/p>\n<p>Do you use tools like ping or ipconfig? Well we now color those tools as well:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"External Tools\" alt=\"External Tools\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2014\/03\/ExternalTools.png\" width=\"218\" height=\"69\" border=\"0\" \/><\/p>\n<p><em>Unknown Command Coloring:<\/em><\/p>\n<p>When the editor is unable to determine what a command is, it will color it as an unknown command. This gives you a visual hint that something maybe be incorrect in the script. For example, if you mistype Get-Process, the commands will display as follows:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"Unknown Command\" alt=\"Unknown Command\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2014\/03\/UnknownCommand.png\" width=\"313\" height=\"61\" border=\"0\" \/><\/p>\n<p><em>DSC Coloring:<\/em><\/p>\n<p>We provide syntax coloring for DSC scripts:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"Configuration\" alt=\"Configuration\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2014\/03\/Configuration.png\" width=\"372\" height=\"139\" border=\"0\" \/><\/p>\n<p>And yes, configurations will appear in the Function Explorer:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"Configuration in Function Explorer\" alt=\"Configuration in Function Explorer\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2014\/03\/ConfigurationinFunctionExplorer.png\" width=\"203\" height=\"223\" border=\"0\" \/><\/p>\n<p>As time progresses, we will be adding more support for DSC.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Improved PrimalSense Support<\/strong><\/p>\n<p>We have also made numerous improvements to PowerShell Studio 2014\u2019s PrimalSense.<\/p>\n<p>Parameter Attribute PrimalSense:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"Parameter Attribute PrimalSense\" alt=\"Parameter Attribute PrimalSense\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2014\/03\/ParameterAttributePrimalSense.png\" width=\"391\" height=\"173\" border=\"0\" \/><\/p>\n<p><em>Parameter Alias for Functions:<\/em><\/p>\n<p>PowerShell Studio will now display parameter alias for user defined functions:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"Function Parameter Aliases\" alt=\"Function Parameter Aliases\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2014\/03\/FunctionParameterAliases.png\" width=\"391\" height=\"310\" border=\"0\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><em>ValidateSet PrimalSense:<\/em><br \/>\nPowerShell Studio even provides ValidateSet PrimalSense for user defined functions:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"Validate Set PrimalSense\" alt=\"Validate Set PrimalSense\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2014\/03\/ValidateSetPrimalSense.png\" width=\"241\" height=\"92\" border=\"0\" \/><\/p>\n<p><em>\u00a0<\/em><\/p>\n<p><em>New-Object Properties<\/em><\/p>\n<p>You can use the New-Object cmdlet\u2019s <em>Properties<\/em> parameter to specify the initial values for the object\u2019s properties using a hash table. PowerShell Studio 2014 makes this easier by providing you with the list of the object type\u2019s properties when working within a hash table:<\/p>\n<p><a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2014\/03\/NewObjectPropertiesHashPrimalSense.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"NewObject Properties Hash PrimalSense\" alt=\"NewObject Properties Hash PrimalSense\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2014\/03\/NewObjectPropertiesHashPrimalSense_thumb.png\" width=\"644\" height=\"248\" border=\"0\" \/><\/a><\/p>\n<p><em><strong><br \/>\nDot Sourcing<\/strong><\/em><\/p>\n<p>We also provide PrimalSense support for dot sourced files, including parameter completion:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"Dot Sourcing Parameters\" alt=\"Dot Sourcing Parameters\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2014\/03\/DotSourcingParameters.png\" width=\"458\" height=\"123\" border=\"0\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>PowerShell Studio now provides syntax coloring for functions in dot sourced files:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"Dot Sourced Functions\" alt=\"Dot Sourced Functions\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2014\/03\/DotSourcedFunctions.png\" width=\"598\" height=\"141\" border=\"0\" \/><\/p>\n<p>Use the editor\u2019s context menu to open the dot sourced file:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"Go To Source File\" alt=\"Go To Source File\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2014\/03\/GoToSourceFile.png\" width=\"447\" height=\"197\" border=\"0\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Block Editing<\/strong><\/p>\n<p>Edit multiple lines at once by pressing\u00a0 (Alt + Shift + Up \/Down):<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"Multiline Editing\" alt=\"Multiline Editing\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2014\/03\/MultilineEditing.png\" width=\"266\" height=\"94\" border=\"0\" \/><\/p>\n<p>The editor also includes various other improvements, including PrimalSense support for PowerShell variables, such as $Error and $_ in the try catch block.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let\u2019s look at some of the new features you will find in PowerShell Studio 2014\u2019s editor. Improved Syntax Coloring One of the first editing features you might have noticed in PowerShell Studio 2014 is the improved syntax coloring. Parameter Attributes and Type Coloring: PowerShell Studio will now color parameter attributes and types when valid: External [&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":[734,874,141],"class_list":["post-7129","post","type-post","status-publish","format-standard","hentry","category-powershell-studio","category-whats-new-software-news","category-windows-powershell","tag-editor","tag-powershell-studio-2014","tag-whats-new"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/7129","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=7129"}],"version-history":[{"count":5,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/7129\/revisions"}],"predecessor-version":[{"id":7176,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/7129\/revisions\/7176"}],"wp:attachment":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/media?parent=7129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/categories?post=7129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/tags?post=7129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}