Format Script - WAI?

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.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
OldLost
Posts: 55
Joined: Mon Jul 22, 2013 7:32 am

Format Script - WAI?

Post by OldLost » Tue Mar 21, 2017 1:13 pm

PowerShell Studio 2017 v5.4.136 x64
Windows Server 2012 R2 64bit

Not sure if it's me or PowerShell Studio's script formatting, but for the below block of code PowerShell Studio is placing the do command on the same line as the else's closing bracket.

Code: Select all

$i = 3
if ($true) {
Write-Host "true"
} else {
Write-Host "false"
} do {
Write-Host "Doing..."
} while ($i--)
So, is this Working As Intended? If writing it yourself where would you put the do? Personally I would place the do on the next line.

User avatar
DevinL
Site Admin
Posts: 1098
Joined: Mon Aug 17, 2015 2:25 pm

Re: Format Script - WAI?

Post by DevinL » Tue Mar 21, 2017 1:51 pm

This should not happen, thank you for bringing it to our attention. I've reproduced this on my end and will file a bug report to have it fixed.

When I have some more information, I'll be sure to post it here.
DevinL
SAPIEN Technologies, Inc.

User avatar
DevinL
Site Admin
Posts: 1098
Joined: Mon Aug 17, 2015 2:25 pm

Re: Format Script - WAI?

Post by DevinL » Tue Mar 21, 2017 1:52 pm

Actually just spoke with the team and it'll be resolved in the next service release.

Thanks again for bringing this to our attention :)
DevinL
SAPIEN Technologies, Inc.

User avatar
DevinL
Site Admin
Posts: 1098
Joined: Mon Aug 17, 2015 2:25 pm

Re: Format Script - WAI?

Post by DevinL » Wed Mar 29, 2017 9:22 am

Hey OldLost,

I would just like to let you know that we released the fix for this issue in our recent service build (5.4.137).
DevinL
SAPIEN Technologies, Inc.