PowerShell Studio 2017 v5.4.143: Using [adsi]'' is so slow

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 7 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
Jehoschua
Posts: 64
Last visit: Fri Mar 01, 2024 3:24 am

PowerShell Studio 2017 v5.4.143: Using [adsi]'' is so slow

Post by Jehoschua »

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

Hello

PowerShell Studio is *very* slow, if the following Code is executed.

The following Code has this execution time:
Without Debbugger: less than 1 second
With the Debugger: about 28 seconds

Code: Select all

$rootCN = [adsi]''
The following Code has this execution time:
Without Debbugger: less than 1 second
With the Debugger: about 28 seconds (about the same time as the command before)

Code: Select all

$node = [pscustomobject] [ordered] @{
	Key = "LDAP://$($rootCN.DistinguishedName)"
	Name = $rootCN.Name
	DistinguishedName = $rootCN.DistinguishedName
	Children = @()
}
Kind regards,
Thomas
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: PowerShell Studio 2017 v5.4.143: Using [adsi]'' is so slow

Post by davidc »

The debugger queries the object's properties when it hits a breakpoint. It is possible that one or more properties are triggering internal ADSI queries, which maybe timing out, thus causing the delay.
David
SAPIEN Technologies, Inc.
This topic is 6 years and 7 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.