[英]How to remove objects in recycle bin Sitecore CMS with powershell scrript?
CMS Sitecore 8.2. CMS Sitecore 8.2。 I have many object in recycle bin - 500k.
我在回收站中有很多 object - 500k。 I want to remove object in bin with powershell.
我想用 powershell 删除 bin 中的 object。 I can't find scripts ps in google.
我在谷歌中找不到脚本 ps。 Help me pls to solve problem.
请帮我解决问题。
You can use Remove-ArchiveItem
command.您可以使用
Remove-ArchiveItem
命令。
Eg to remove item with ID "{1BB32980-66B4-4ADA-9170-10A9D3336613}"
from Recycle Bin, use:例如,要从回收站中删除 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}"
To remove all the items from Recycle Bin, use:要从回收站中删除所有项目,请使用:
$database = Get-Database -Name "master"
$archiveName = "recyclebin"
$archive = Get-Archive -Database $database -Name $archiveName
Get-ArchiveItem -Archive $archive | Remove-ArchiveItem
You can find those and more examples in the documentation here: https://doc.sitecorepowershell.com/appendix/common/remove-archiveitem您可以在此处的文档中找到这些以及更多示例: https://doc.sitecorepowershell.com/appendix/common/remove-archiveitem
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.