level 2
残月独照
楼主
今天遇到一个奇葩问题:
out-lineoutput : The object of type "Microsoft.PowerShell.Commands.Internal.Format.FormatStartData" is not valid or not
in the correct sequence. This is likely caused by a user-specified "format-table" command which is conflicting with th
e default formatting.
+ CategoryInfo : InvalidData: (:) [out-lineoutput], InvalidOperationException
+ FullyQualifiedErrorId : ConsoleLineOutputOutOfSequencePacket,Microsoft.PowerShell.Commands.OutLineOutputCommand
Google了一下,发觉自己真相了。。
“The reason the last function gives the error is that you are outputting both
raw objects and MSH formatting information generated by format-list.”
意思就是在用 format-* 之前,要确保这个object没有被打出来过。
Echo $object
Echo $object | format-table
会失败
Echo $object | format-table
Echo $object | format-table
会成功
2016年04月21日 06点04分
1
out-lineoutput : The object of type "Microsoft.PowerShell.Commands.Internal.Format.FormatStartData" is not valid or not
in the correct sequence. This is likely caused by a user-specified "format-table" command which is conflicting with th
e default formatting.
+ CategoryInfo : InvalidData: (:) [out-lineoutput], InvalidOperationException
+ FullyQualifiedErrorId : ConsoleLineOutputOutOfSequencePacket,Microsoft.PowerShell.Commands.OutLineOutputCommand
Google了一下,发觉自己真相了。。
“The reason the last function gives the error is that you are outputting both
raw objects and MSH formatting information generated by format-list.”
意思就是在用 format-* 之前,要确保这个object没有被打出来过。
Echo $object
Echo $object | format-table
会失败
Echo $object | format-table
Echo $object | format-table
会成功