Steps
- Open your SharePoint Management Shell.
- Copy the code given below and paste it.
- Run the code given below.
- Open your SharePoint site
- Check if the execution completed successfully or not.
Code
- $siteURL = "https://gowtham.sharepoint.com/tutorial"
- $ListName="Tutorials"
- $site = new-object Microsoft.SharePoint.SPSite ($siteURL)
- $web = $site.OpenWeb()
- $oList = $web.Lists[$ListName];
- $collListItems = $oList.Items;
- $count = $collListItems.Count -1;
- for($intIndex = $count; $intIndex -ge 0; $intIndex--)
- {
- $collListItems[$intIndex].Delete();
- }
Thanks for reading the blog.