0

Below is the Sitecore Powershell Script to delete selected items from Powershell script result -

foreach($Item in $selectedData)
{
    if($Item -ne $null)
    {
        $Item | Remove-Item

    }
}

But the deleted items still appear in ListView results. How to update the list view results?

enter image description here

2

You will need to get the item from either from master or web database and after that need to remove it from the all data list and then need to update the list view -

foreach($selectedItem in $selectedData) {
$item = Get-Item -Path "master:" -ID $selectedItem.ID


$item | Remove-Item
    $allData.Remove($selectedItem)
}

$allData | Update-ListView
  • Thanks! It worked for me. – NewbieHere Oct 14 at 13:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.