Skip to content

Instantly share code, notes, and snippets.

@rezanid
Last active February 15, 2025 17:34
Show Gist options
  • Select an option

  • Save rezanid/ba6ab22dfff709e9392485a45f7f4271 to your computer and use it in GitHub Desktop.

Select an option

Save rezanid/ba6ab22dfff709e9392485a45f7f4271 to your computer and use it in GitHub Desktop.
Power Platform Bulk Delete using PSDataverse and Web API filter.
Connect-Dataverse -Url https://something.crm.dynamics.com
do { $result = Send-DataverseOperation "ordercloses?`$select=activityid" |
Select-Object -ExpandProperty Content |
ConvertFrom-Json |
Select-Object -ExpandProperty value |
ForEach-Object { [pscustomobject]@{ "Method"="DELETE"; "Uri"="ordercloses($($_.activityid))" } | ConvertTo-Json } |
Send-DataverseOperation -BatchSize 200 -MaxDop 50 -ErrorVariable ErrOperation -OutputTable
} while ( $result )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment