Quantcast
Channel: Windows PowerShell - SAPIEN Blog
Viewing all articles
Browse latest Browse all 308

PowerShell Studio 2016: What’s New? (Part 3)

$
0
0

PowerShell Studio 2016 is released! We’ve written a series of blog posts to introduce you to the newest features. In Part 1, we reviewed new UI features, including our new dark themes. In Part 2, we covered new debugging features, including variable and function breakpoints and improvements to the Variables pane.

In Part 3, we will look at some of the new editor features of PowerShell Studio 2016.

 

Import Functions

PowerShell Studio already allowed you to convert functions into a new module (File->New->New Module from Functions). Now, with PowerShell Studio 2016, you can import functions into your existing scripts or modules.

You can find the Import Functions feature in the Edit group in the Home tab of the ribbon:

image

Or in the Functions panel:

image

You’ll be prompted to select the files that contain the functions. You can select and remove files at any time. All functions in the files will be listed in the Import Functions dialog box.

image

To insert the checked functions in the script, press the Import button.

image

 

Code Folding Options

PowerShell Studio supported collapsible code in the form of regions, multiline comments, and script blocks. PowerShell Studio 2016 lets you control which regions collapse and expand when you use the collapse / expand commands.

To select collapsible regions, in the Edit group on the ribbon, click Regions, and then click Include.

image

 

New Code Formatting Options

We added two new formatting options.

Automatically expand aliases

When enabled, this option expands command and parameter aliases when formatting your script.

Before:
image

After:
image

Convert curly quotes to straight quotes

When enabled, this option automatically replaces curly quotes (blog quotes) with straight quotes when formatting your script.

Before:
image

After:
image

 

TODO / DONE Tasks comments

When creating event handlers for PowerShell GUI applications, you might have noticed that a TODO: comment is included:

image

These comments are meant to be reminders that you have to place your custom script in the event script block.

To help you find these uncompleted tasks, PowerShell Studio will display the TODO: comments in the Navigation menu that is located in the upper right corner of the Script tab:

image

Tip

DONE: comments will appear in the Navigation menu as you complete the tasks.

To quickly jump directly to these task comments in your script, select them from the Navigation menu.

 

New Document Tab Commands

PowerShell Studio 2016 adds a few new commands to the context menu that appears when you right click the tab for a file:

SNAGHTML19dce1f

Copy File Name

Copies the file name to the clipboard.

Copy Folder Path

Copies the file folder path to the clipboard.

Reload Document

Reloads the document, undoing any unsaved changes.

 

Edit Options

For your convenience, we moved all PrimalSense-related options to their own Options page:

image

Separating these options declutters the Editor page and makes it easier for you to find the settings you are looking for.

image

Now, all the auto-insert options are grouped in one convenient location.

 

PowerShell V2 Compatibility 

In build v5.2.116, we introduced a new option (Options->Designer): Enable PowerShell V2 assembly compatibility.

image

When this option is enabled, PowerShell Studio will use .NET 2.0 assembly references when generating GUI scripts and will warn you if any assembly does not support the .NET 2.0 Runtime.

Tip
You can access the file’s assemblies using the Ribbon->Home->Edit->Assemblies:

image

If the option is unchecked, it will use the 4.0 .NET or later assemblies and place a #requires –Version comment at the top of the generated script.

 

 

Next we will look at PowerShell Studio 2016’s new Custom PrimalSense feature.

 

 
[Google+]   [Facebook]   [LinkedIn]   [StumbleUpon]   [Digg]   [Reddit]   [Google Bookmark]  


Viewing all articles
Browse latest Browse all 308

Trending Articles