Skip to content

Commit 868ca16

Browse files
committed
reinstate query param until Get deprecation
1 parent 366b795 commit 868ca16

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ServiceNow/Private/Invoke-ServiceNowRestMethod.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ function Invoke-ServiceNowRestMethod {
4747
[System.Collections.ArrayList] $Sort = @('opened_at', 'desc'),
4848

4949
# sysparm_query param in the format of a ServiceNow encoded query string (see http://wiki.servicenow.com/index.php?title=Encoded_Query_Strings)
50-
# [Parameter()]
51-
# [string] $Query,
50+
[Parameter()]
51+
[string] $Query,
5252

5353
# Fields to return
5454
[Parameter()]
@@ -78,7 +78,7 @@ function Invoke-ServiceNowRestMethod {
7878
if ( $Table ) {
7979
# table can either be the actual table name or class name
8080
# look up the actual table name
81-
$tableName = $script:ServiceNowTable | Where-Object { $_.Name -eq $Table -or $_.ClassName -eq $Table } | Select-Object -ExpandProperty Name
81+
$tableName = $script:ServiceNowTable | Where-Object { $_.Name.ToLower() -eq $Table.ToLower() -or $_.ClassName.ToLower() -eq $Table.ToLower() } | Select-Object -ExpandProperty Name
8282
# if not in our lookup, just use the table name as provided
8383
if ( -not $tableName ) {
8484
$tableName = $Table
@@ -115,9 +115,9 @@ function Invoke-ServiceNowRestMethod {
115115
$Body['sysparm_offset'] = $PSCmdlet.PagingParameters.Skip
116116
}
117117

118-
# if ($Query) {
119-
# $Body.sysparm_query = $Query
120-
# }
118+
if ($Query) {
119+
$Body.sysparm_query = $Query
120+
}
121121

122122
if ($Property) {
123123
$Body.sysparm_fields = ($Property -join ',').ToLower()

0 commit comments

Comments
 (0)