【问题标题】:Sitecore PowerShell : Remove-Item not deleting, How to troubleshoot?Sitecore PowerShell:删除项目未删除,如何排除故障?
【发布时间】:2019-02-19 16:29:35
【问题描述】:

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

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

运行时不删除也不出错。

我怎样才能知道为什么它没有被删除?

【问题讨论】:

  • MSDocs 站点和我的 ps5.1 帮助文件未列出 Remove-Item-Permanently 参数。那是定制的包装器还是带有附加模块的版本?
  • 感谢您的调查。这是 sitecore powershell,Remove-Item 用于删除 sitecore 元素。它与 Remove-Item 同名,用于删除文件或文件夹。
  • 感谢您的澄清! [grin]我现在已经超出了我的深度,所以我会回去潜伏......

标签: powershell sitecore sitecore8


【解决方案1】:

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

$child1 |删除项目

显然您的脚本不会引发错误,但删除无法以这种方式工作。 参见文档https://doc.sitecorepowershell.com/working-with-items

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-07-17
    • 2023-03-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-07
    • 2017-02-22
    相关资源
    最近更新 更多