Format Script leaves trailing whitespace on the line after an indented closing brace "}"

Support for all customers who have purchased a SAPIEN PowerShell Studio product license. This forum does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
User avatar
shawnwestin
Posts: 58
Joined: Thu Oct 18, 2012 3:29 am

Format Script leaves trailing whitespace on the line after an indented closing brace "}"

Post by shawnwestin » Tue Nov 14, 2017 8:26 am

To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product, version and build: PowerShell Studio 2017 v5.4.145
32 or 64 bit version of product: 64 bit
Operating system: Windows 7
32 or 64 bit OS: 64 bit

*** Please add details and screenshots as needed below. ***

Format Script (Ctrl + Shift + J) leaves trailing whitespace on the line after an indented closing brace "}"

ie.

Code: Select all

function Install-Something()
{
    if (!$installed)
    {
        Invoke-Install
    }
    ### trailing whitespace here equal to the indent of the closing brace "}" after using Format Script ###
    return 0
}
### NO trailing whitespace here since the indent of the closing brace "}" is 0 spaces ###

User avatar
cody m
Site Admin
Posts: 39
Joined: Thu Jun 01, 2017 7:20 am

Re: Format Script leaves trailing whitespace on the line after an indented closing brace "}"

Post by cody m » Tue Nov 14, 2017 9:05 am

PowerShell studio is acting correctly here, the return statement and the last "}" of the if statement should placed in the same column which in your example it is. This is really a matter of style preference, since PowerShell doesn't read indentations as a way to separate logical blocks.
Cody McCants
SAPIEN Technologies, Inc.