Multi-line code formatting issue

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.
User avatar
JohnMoe
Posts: 16
Meble kuchenne na zamówienie - na wymiar - Wrocław
Joined: Sun Apr 15, 2018 11:36 pm

Multi-line code formatting issue

Post by JohnMoe »

Product: PowerShell Studio 2020 (64 Bit)
Build: v5.7.172
OS: Windows 10 Pro (64 Bit)
Build: v10.0.18362.0

I've got some code that gets the computers from three seperate ActiveDirectory OUs, and joins them together into one array, similar to this:

Code: Select all

$allComputers = @(Get-ADComputer -Filter { Name -like 'prefix*a' } -SearchBase 'OU=Store 01 Computers,OU=Computers,OU=Company,DC=company,DC=com,DC=au' -SearchScope OneLevel) + `
                @(Get-ADComputer -Filter { Name -like 'prefix*a' } -SearchBase 'OU=Store 02 Computers,OU=Computers,OU=Company,DC=company,DC=com,DC=au' -SearchScope OneLevel) + `
                @(Get-ADComputer -Filter { Name -like 'prefix*a' } -SearchBase 'OU=Store 03 Computers,OU=Computers,OU=Company,DC=company,DC=com,DC=au' -SearchScope OneLevel) | Sort-Object -Property Name
PowerShell Studio keeps formatting it like this:

Code: Select all

$allComputers = @(Get-ADComputer -Filter { Name -like 'prefix*a' } -SearchBase 'OU=Store 01 Computers,OU=Computers,OU=Company,DC=company,DC=com,DC=au' -SearchScope OneLevel) + `
@(Get-ADComputer -Filter { Name -like 'prefix*a' } -SearchBase 'OU=Store 02 Computers,OU=Computers,OU=Company,DC=company,DC=com,DC=au' -SearchScope OneLevel) + `
@(Get-ADComputer -Filter { Name -like 'prefix*a' } -SearchBase 'OU=Store 03 Computers,OU=Computers,OU=Company,DC=company,DC=com,DC=au' -SearchScope OneLevel) | Sort-Object -Property Name
I would have thought that it should either align the parts after the = sign, or at least indent each following line after the first one.

User avatar
Olga_B
Site Admin
Posts: 137
Joined: Mon May 15, 2017 9:06 am

Re: Multi-line code formatting issue

Post by Olga_B »

Thanks for reporting this issue.
We will investigate it and will update you as soon as we have more information.