Skip to content

Commit c0f2018

Browse files
committed
Fixed misses in tweak/cleanup.
1 parent 0506b28 commit c0f2018

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

ServiceNow/Public/New-ServiceNowQuery.ps1

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)