Created
November 25, 2016 01:57
-
-
Save dnstommy/72736ea557a0e3a5f1e66015857a2b8c to your computer and use it in GitHub Desktop.
Deleting all versions of a language with SPE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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