2
我爲了在路徑創建新的語言文件運行Sitecore的PowerShell中代碼的對象的當前狀態:操作無效由於使用Sitecore的
Get-ChildItem "master:\Print Studio\Print Studio Projects\Maax Product Catalogs\Prof CAN Catalog T2\Books\P_Book\Documents\Full Catalog FR\Pages\Prof-FSBathtubsSectionSnippet\" -Recurse -Language "en" | `
Add-ItemLanguage -TargetLanguage "fr-CA" -IfExist Append | `
Format-Table Name, Language, Version -auto
使用時-Recurse
我得到這個錯誤
The object of type "Microsoft.PowerShell.Commands.Internal.Format.FormatStartData" is not valid or does not appear in the correct order. The reason is probably a conflict between an order "format-list" specified by the user and default formatting.
Of type: System.Management.Automation.CmdletInvocationException
Stack trace:
to System.Management.Automation.Internal.PipelineProcessor.DoStepItems (Object input, errorResults Hashtable, Boolean enumerate)
to Microsoft.PowerShell.Commands.Internal.Format.CommandWrapper.Process (Object o)
to Microsoft.PowerShell.Commands.Internal.Format.SubPipelineManager.Process (PSObject so)
to Microsoft.PowerShell.Commands.Internal.Format.OutputManagerInner.ProcessRecord()
to Microsoft.PowerShell.Commands.Internal.Format.FrontEndCommandBase.ProcessRecord()
to System.Management.Automation.CommandProcessor.ProcessRecord()
Inner Exception: The operation is not valid due to the current state of the object.
Of type: System.InvalidOperationException
Stack trace:
to System.Management.Automation.MshCommandRuntime.ThrowTerminatingError (ErrorRecord ErrorRecord)
以及何時不使用-Recurse
該代碼起作用。
'@(GET-ChildItem ... |添加-ItemLanguage ...)|格式Table' –
我會用'的Get-更換'格式Table'開始進行故障排除Member'。通過這種方式,您可以確認哪些對象通過管道傳遞到輸出命令。您也可能希望輸出所有字段,並確保您沒有任何重複的字段名稱。 – Coding101