We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 70d7709 commit ed6448aCopy full SHA for ed6448a
ServiceNow/Public/New-ServiceNowQuery.ps1
@@ -185,10 +185,13 @@ function New-ServiceNowQuery {
185
}
186
187
$orderList = $Sort
188
- # see if we're working with 1 array or multidimensional array
189
- # we want multidimensional so convert if not
190
- if ($Sort[0].GetType().Name -eq 'String') {
191
- $orderList = @(, $Sort)
+
+ if ( $Sort ) {
+ # see if we're working with 1 array or multidimensional array
+ # we want multidimensional so convert if not
192
+ if ($Sort[0].GetType().Name -eq 'String') {
193
+ $orderList = @(, $Sort)
194
+ }
195
196
197
$query += for ($i = 0; $i -lt $orderList.Count; $i++) {
0 commit comments