Skip to content

Commit ba5ad9d

Browse files
authored
query operator fix for -notin and -notlike (#134)
1 parent 31f6d21 commit ba5ad9d

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.3.1
2+
- Fix query operator -notin and -notlike which had a missing space
3+
- Move verbose logging message in `Invoke-ServiceNowRestMethod` for number of records so it always shows. This is helpful when you change a filter and can see how many records would be returned without actually returning them.
4+
15
## v2.3
26
- Add paging support to all `Get-` functions. Use `-First`, `-Skip`, and `-IncludeTotalCount` parameters. In support of this, api calls have been changed from Invoke-RestMethod to Invoke-WebRequest.
37
- Additional pipline support added for Table and SysId parameters to pipe `Get-` functions to `Update-` and `Remove-`.

ServiceNow/Private/Invoke-ServiceNowRestMethod.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,12 @@ function Invoke-ServiceNowRestMethod {
167167
$records = @($content)
168168
}
169169

170+
$totalRecordCount = [int]$response.Headers.'X-Total-Count'
171+
Write-Verbose "Total number of records for this query: $totalRecordCount"
172+
170173
# if option to get all records was provided, loop and get them all
171174
if ( $PSCmdlet.PagingParameters.IncludeTotalCount.IsPresent ) {
172175

173-
$totalRecordCount = [int]$response.Headers.'X-Total-Count'
174-
Write-Verbose "Total number of records found was $totalRecordCount"
175176
Write-Warning "Getting $($totalRecordCount - $PSCmdlet.PagingParameters.Skip) records, this could take a while..."
176177

177178
$setPoint = $params.body.sysparm_offset + $params.body.sysparm_limit

ServiceNow/ServiceNow.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
RootModule = 'ServiceNow.psm1'
66

77
# Version number of this module.
8-
ModuleVersion = '2.3.0'
8+
ModuleVersion = '2.3.1'
99

1010
# ID used to uniquely identify this module
1111
GUID = 'b90d67da-f8d0-4406-ad74-89d169cd0633'

ServiceNow/config/main.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
},
8787
{
8888
"Name": "-notlike",
89-
"QueryOperator": "NOTLIKE",
89+
"QueryOperator": "NOT LIKE",
9090
"Description": "value is not found anywhere in field",
9191
"RequiresValue": true
9292
},
@@ -98,7 +98,7 @@
9898
},
9999
{
100100
"Name": "-notin",
101-
"QueryOperator": "NOTIN",
101+
"QueryOperator": "NOT IN",
102102
"Description": "field is populated by any value except for these",
103103
"RequiresValue": true
104104
},

0 commit comments

Comments
 (0)