File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -54,23 +54,25 @@ function New-ServiceNowQuery {
5454 }
5555 [void ]$Query.Append ($Order )
5656
57+ # Add OrderBy
58+ [void ]$Query.Append ($OrderBy )
59+
5760 # Build the exact matches into the query
5861 If ($MatchExact ) {
59- $Match = ForEach ($Field in $MatchExact.keys ) {
60- " ^{0}={1}" -f $Field.ToString ().ToLower(), ($MatchExact .$Field )
62+ ForEach ($Field in $MatchExact.keys ) {
63+ $ExactString = " ^{0}={1}" -f $Field.ToString ().ToLower(), ($MatchExact .$Field )
64+ [void ]$Query.Append ($ExactString )
6165 }
6266 }
6367
6468 # Add the values which given fields should contain
6569 If ($MatchContains ) {
66- $Match = ForEach ($Field in $MatchContains.keys ) {
67- " ^{0}LIKE{1}" -f $Field.ToString ().ToLower(), ($MatchContains .$Field )
70+ ForEach ($Field in $MatchContains.keys ) {
71+ $ContainsString = " ^{0}LIKE{1}" -f $Field.ToString ().ToLower(), ($MatchContains .$Field )
72+ [void ]$Query.Append ($ContainsString )
6873 }
6974 }
7075
71- # Append Match (Exact or Contains)
72- [void ]$Query.Append ($Match )
73-
7476 # Output StringBuilder to string
7577 $Query.ToString ()
7678 }
You can’t perform that action at this time.
0 commit comments