Remove-ServiceNow Cmdlet
Deletes ServiceNow data.
Syntax
Remove-ServiceNow [parameters]
Remarks
The Remove-ServiceNow cmdlet allows you to use a syntax similar to SQL DELETE statements to delete ServiceNow data.
$conn = Connect-ServiceNow -OAuthClientId "MyClientId" -OAuthClientSecret "MyClientSecret" -Password "MyPassword" -User "MyUser" -Url "https://MyInstance12345.service-now.com/" Remove-ServiceNow -Connection $conn -Table "incident" -Id "S"The Where parameter can also be used to specify the primary key:
Remove-ServiceNow -Connection $conn -Table "exTablePowershell;" -Where "sys_id = S"The primary key can also be passed to the cmdlet along the pipeline:
Select-ServiceNow -Connection $conn -Table incident -Where "category = 'request'" | Remove-ServiceNow