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

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION 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.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 6 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
shawnwestin
Posts: 59
Last visit: Mon Aug 14, 2023 7:21 am

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

Post by shawnwestin »

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 ###
cody m

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

Post by cody m »

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.
This topic is 6 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.