Sitecore Powershell反序列化

Eng*_*der 5 powershell serialization sitecore

我正在尝试使用Sitecore Powershell Extensions 251执行反序列化.我无法使反序列化工作.这是我做的:

  • 我序列化了sitecore\content\settings\testItem项.序列化成功,包创建.

    Get-Item"master:\ content\settings\testItem"| Serialize-Item -Recurse

  • 我删除项目sitecore\content\settings\testItem并尝试使用以下命令反序列化:

    Deserialize-Item -Path master:\ content\settings\TestItem -Recurse

我得到以下异常:

writeErrorStream      : True
Exception             : System.Exception: path is not under the root
                           bei Sitecore.Data.Serialization.PathUtils.GetShortPath(String path)
                           bei Sitecore.Data.Serialization.Manager.LoadTree(String path, LoadOptions options)
                           bei Cognifide.PowerShell.PowerShellIntegrations.Commandlets.Serialization.DeserializeItemCommand.Deserialize(String path)
                           bei Cognifide.PowerShell.PowerShellIntegrations.Commandlets.Serialization.DeserializeItemCommand.ProcessRecord()
                           bei System.Management.Automation.CommandProcessor.ProcessRecord()
TargetObject          :
CategoryInfo          : NotSpecified: (:) [Deserialize-Item], Exception
FullyQualifiedErrorId : System.Exception,Cognifide.PowerShell.PowerShellIntegrations.Commandlets.Serialization.DeserializeItemCommand
ErrorDetails          :
InvocationInfo        : System.Management.Automation.InvocationInfo
PipelineIterationInfo : {0, 1}
PSMessageDetails      :
Run Code Online (Sandbox Code Playgroud)

我在网上搜索过,但是找不到反序列化的文档/示例.任何人都可以写信给我如何进行反序列化,如果可以的话,请参考网上的文档或示例资源吗?`

感谢名单

Mar*_*lak 5

deserialize-item coomand需要2个参数:

  1. Path- 硬盘到目录的路径
  2. Root- serialization目录的位置

并且Recurse可选地,例如:

deserialize-item -Path "C:\project\data\serialization\master\sitecore\content\settings" -Root "C:\project\data\serialization\" -Recurse
Run Code Online (Sandbox Code Playgroud)

在上面的代码中更新页面的开头,以便它们与您的环境相匹配.

这是一篇博客文章,解释了Sitecore Powershell Extensions的序列化和反序列化.