TIP: Query servicenow Incident record using PowerShell and REST API
Posted onIn order to query the servicenow incident records and to list out the required fields use the sysparm_fields column which helps in optimization. Now, See the code, result and performance All Fields function Get-ServiceNowIncident { [CmdletBinding()] param ( [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] $IncidentID, [Parameter(Mandatory)] [pscredential] $Credential ) try { $Uri = “https://dev42835.service-now.com/api/now/table/incident?sysparm_query=number=$($IncidentID)” $Result = Invoke-RestMethod -Uri […]