The script I have right now, deletes all the items in the list. But I want to change the script so it only deletes specific records.
For example, I want to do a loop and if the businessid (column) value is equal to 9999, delete the record.
below is a script that i have to delete all items in the list (but this isnt what I want to do )
Add-PSSnapin Microsoft.SharePoint.PowerShell
$web = get-spweb "https://staging/training/"
$List = $web.lists["ItemsList"]
$Items = $List.GetItems()
$Items | ForEach-Object{
$List.GetItemById($_.Id).Delete()
}
$List.Update()