Skip to content

Instantly share code, notes, and snippets.

@dnstommy
Created November 25, 2016 01:57
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 dnstommy/72736ea557a0e3a5f1e66015857a2b8c to your computer and use it in GitHub Desktop.
Save dnstommy/72736ea557a0e3a5f1e66015857a2b8c to your computer and use it in GitHub Desktop.
Deleting all versions of a language with SPE
$languageitems = Find-Item `
-Index sitecore_master_index `
-Criteria @{Filter = "Contains"; Field = "_language"; Value = "de-de"}, @{Filter = "StartsWith"; Field = "_fullpath"; Value = "/sitecore/content/" }
if($languageitems)
{
foreach($languageitem in $languageitems)
{
$id = $languageitem.ItemId
Write-Host "Removing item id $id"
Remove-ItemVersion -Id $id -Language de-de
}
}
else
{
Write-Host "No Languages to delete"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment