insomniacc / PSSnow

A powershell module for interacting with the ServiceNow REST API
GNU General Public License v3.0
40 stars 9 forks source link

Add Invoke-SNOWBatch #1

Closed insomniacc closed 1 year ago

insomniacc commented 1 year ago

Write Invoke-SNOWBatch to handle submissions to the batch API as per: https://docs.servicenow.com/bundle/sandiego-application-development/page/integrate/inbound-rest/concept/batch-api.html

All table functions should have a hidden? 'AsBatchRequest' parameter that allows the return of a formatted payload suitable to be passed into the Invoke-SNOWBatch function for bulk submission.

Invoke-SNOWBatch should also have a -scriptblock param that can be used as a wrapper around code to effectively do the same as the previous statement, but automatically recognise and apply the -AsBatchRequest parameter and collect the output, making it more user friendly.

Invoke-SNOWBatch should leverage Invoke-Parallel for 5.1 usage.

insomniacc commented 1 year ago

Completed initial functionality.