$spWeb =get-spweb http://.....$spList =$spWeb.GetListFromUrl("http://..../Lists/Tasks/AllItems.aspx")$spQuery = New-Object Microsoft.SharePoint.SPQuery$camlQuery = '<Where><Leq><FieldRef Name="Created" /><Value Type="DateTime">2017-04-18</Value></Leq></Where>'$spQuery.Query = $camlQuery$spListItem = $spList.GetItems($spQuery)$spListItem[0].ID$spListItem[0].UniqueId$spListItem[0].TitleWrite-Host $spListItem.Count$spListItem|%{$spList.GetItemById($_.Id).Delete()}$spList.Update()
转载于:https://www.cnblogs.com/wangbaohui/p/7098515.html
相关资源:JAVA上百实例源码以及开源项目