Skip to content

Instantly share code, notes, and snippets.

@buettiB
Last active May 12, 2017 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buettiB/03d601280e287910a847810d68251ec3 to your computer and use it in GitHub Desktop.
Save buettiB/03d601280e287910a847810d68251ec3 to your computer and use it in GitHub Desktop.
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