[英]How to remove objects in recycle bin Sitecore CMS with powershell scrript?
CMS Sitecore 8.2。 我在回收站中有很多 object - 500k。 我想用 powershell 刪除 bin 中的 object。 我在谷歌中找不到腳本 ps。 請幫我解決問題。
您可以使用Remove-ArchiveItem
命令。
例如,要從回收站中刪除 ID 為"{1BB32980-66B4-4ADA-9170-10A9D3336613}"
的項目,請使用:
$database = Get-Database -Name "master"
$archiveName = "recyclebin"
$archive = Get-Archive -Database $database -Name $archiveName
Remove-ArchiveItem -Archive $archive -ItemId "{1BB32980-66B4-4ADA-9170-10A9D3336613}"
要從回收站中刪除所有項目,請使用:
$database = Get-Database -Name "master"
$archiveName = "recyclebin"
$archive = Get-Archive -Database $database -Name $archiveName
Get-ArchiveItem -Archive $archive | Remove-ArchiveItem
您可以在此處的文檔中找到這些以及更多示例: https://doc.sitecorepowershell.com/appendix/common/remove-archiveitem
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.