Skip to content

Instantly share code, notes, and snippets.

@garrytrinder
Created December 24, 2018 16:03
Show Gist options
  • Save garrytrinder/9997a70723cf9d4b0d8240d6d09dbe04 to your computer and use it in GitHub Desktop.
Save garrytrinder/9997a70723cf9d4b0d8240d6d09dbe04 to your computer and use it in GitHub Desktop.
Removes all list items from a SharePoint List
Param(
[Parameter(Mandatory=$true)]
[string]$ListName
)
Get-PnPListItem -List $ListName | ForEach-Object { Remove-PnPListItem -List $ListName -Identity $_ -Force; Write-Host "Removed item $($_.Id)" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment