Closed iRon7 closed 2 years ago
This implementation implies a breaking change for expressions as they could either represent a key expression (supplied via the -On
and possibly via the -Equals
parameter) or a comparison expression which now requires and an explicit named -Using
parameter.
Comparison expressions are expressive, e.g.:
is a lot faster than
Because in the first situation
$List1
is streamed thought the pipeline and each related property item is looked up in a hashtable that contains the related$List2
property items. In the later syntax the expression is invoked for each possible combination between each$List1
item and$List2
item meaning that the expression is evaluated ($List.Count * $List2.Count
times). Therefore the comparison expression should only be used for comparison other than-eq
(equals) such as-gt
. Yet, there might be situations where you might want to build an expression for a key only, that for example: How do I find a user by DisplayName in one CSV file given a DistinguishedName is another CSV file?Let's presume a forest with two separate domains where I would like to define a relation between a part of the
DN
or a User name and a FirstName/LastName at the other side:Example 1
Example 2
Both Join commands result in:
And faster than a comparison expression as they still use a hashtable lookup.