Skip to content

Instantly share code, notes, and snippets.


buettiB/DeleteItemsCAML.ps1 Secret

Last active May 12, 2017
What would you like to do?
Löscht Listenelemente die aus einer CAML Abfrage zurückgegeben werden
Add-PSSnapin Microsoft.SharePoint.PowerShell
$caml = '<Where><Eq><FieldRef Name="Auswahl"/><Value Type="Text">Drei</Value></Eq></Where>'
$query = new-object Microsoft.SharePoint.SPQuery
$meineItems = (get-spweb http://hamburg/).Lists["Meine Liste"].GetItems($query)
$meineItems | %{$_.ParentList.GetItemById($_.Id).Delete()}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment