1

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

1 Answer 1

4

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
1
  • Thanks! It worked for me.
    – NewbieHere
    Commented Oct 14, 2019 at 13:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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