Skip to content

Instantly share code, notes, and snippets.

@buettiB

buettiB/DeleteItemsCAML.ps1 Secret

Last active May 12, 2017
Embed
What would you like to do?
Löscht Listenelemente die aus einer CAML Abfrage zurückgegeben werden
Add-PSSnapin Microsoft.SharePoint.PowerShell
cls
$caml = '<Where><Eq><FieldRef Name="Auswahl"/><Value Type="Text">Drei</Value></Eq></Where>'
$query = new-object Microsoft.SharePoint.SPQuery
$query.Query=$caml
$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