Page 1 of 1

Multi-line code formatting issue

Posted: Thu Jan 30, 2020 6:51 pm
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.

Re: Multi-line code formatting issue

Posted: Fri Jan 31, 2020 10:21 am
by Olga_B
Thanks for reporting this issue.
We will investigate it and will update you as soon as we have more information.