首页 > 解决方案 > Sitecore PowerShell:删除项目未删除,如何排除故障?

问题描述

我有简单的 Sitecore8/PowerShell 脚本,我在其中删除图像子项并发布父项:

$child1 = Get-Item $child1Path
Remove-Item $child1 -Force -Permanently 
Publish-Item -Item $parent1 -Recurse -PublishMode SingleItem -Language "en*"

运行时没有删除和错误。

我怎样才能找出它为什么不删除?

标签: powershellsitecoresitecore8

解决方案


您可以将 Remove-Item 与 -Path 参数一起使用。或使用

$child1 | 除去项目

显然你的脚本不会抛出错误,但删除不是这样工作的。请参阅文档https://doc.sitecorepowershell.com/working-with-items


推荐阅读