You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,9 @@
1
+
## v2.3
2
+
- 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.
3
+
- Additional pipline support added for Table and SysId parameters to pipe `Get-` functions to `Update-` and `Remove-`.
4
+
-***Breaking change:*** deprecate `-Limit` parameter. The warning regarding deprecation went out over 2 years ago and now that paging has been implemented, it's a good time for this cleanup. Use `-First` instead.
5
+
- 'TableEntry' renamed to 'Record' for `New-`, `Update-`, and `Remove-` functions. Aliases added.
6
+
1
7
## v2.2
2
8
- Add advanced filtering and sorting. Initially implemented with `New-ServiceNowQuery` and `Get-ServiceNowRecord`. Filter with many different comparison operators as well as 'and', 'or', and 'group'ing. Sort ascending or descending against multiple fields. Comparison operators are the same as PowerShell for ease of use. Please use the GitHub Discussions section to provide feedback, thoughts, etc.
3
9
- Add `Get-ServiceNowRecord`. This function implements the new advanced filtering and sorting. As long as you know your table name, this can replace all other Get functions.
Write-Verbose ('getting {0}-{1} of {2}'-f ($params.body.sysparm_offset+1),$end,$totalRecordCount)
193
+
$response=Invoke-WebRequest@params-Verbose:$false
194
+
195
+
$content=$response.content|ConvertFrom-Json
196
+
if ( $content.PSobject.Properties.Name-contains"result" ) {
197
+
$records+=$content|Select-Object-ExpandProperty result
198
+
}
199
+
else {
200
+
$records+=$content
201
+
}
202
+
}
203
+
204
+
if ( $totalRecordCount-ne ($records.count+$PSCmdlet.PagingParameters.Skip) ) {
205
+
Write-Error ('The expected number of records was not received. This can occur if your -First value, how many records retrieved at once, is too large. Lower this value and try again. Received: {0}, expected: {1}'-f$records.count, ($totalRecordCount-$PSCmdlet.PagingParameters.Skip))
206
+
}
207
+
}
208
+
209
+
# set the progress pref back now that done with invoke-webrequest
210
+
$ProgressPreference=$oldProgressPreference
177
211
178
212
switch ($Method) {
179
213
'Get' {
180
-
if ( $response.PSobject.Properties.Name-contains"result" ) {
181
-
182
-
$result=$response|Select-Object-ExpandProperty result
If (-not [string]::IsNullOrEmpty($SNResult.$Property)) {
218
+
Try {
219
+
# Extract the default Date/Time formatting from the local computer's "Culture" settings, and then create the format to use when parsing the date/time from Service-Now
# Extract the default Date/Time formatting from the local computer's "Culture" settings, and then create the format to use when parsing the date/time from Service-Now
0 commit comments