【发布时间】:2016-10-13 16:21:36
【问题描述】:
我在 powershell 脚本中运行以下脚本并出现错误。
$queues = Get-WmiObject Win32_PerfFormattedData_msmq_MSMQQueue
$list = $queues | ft - 属性名称,MessagesInQueue
for ( $i = 0; $i -lt 6; $i++ ) {
如果 ($i -gt 2) {
$list[$i]
}
}
错误: out-lineoutput :“Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData”类型的对象无效或顺序不正确。这很可能是由一个 与默认格式冲突的用户指定的“format-*”命令。 + CategoryInfo : InvalidData: (:) [out-lineoutput], InvalidOperationException + FullyQualifiedErrorId : ConsoleLineOutputOutOfSequencePacket,Microsoft.PowerShell.Commands.OutLineOutputCommand
【问题讨论】:
标签: powershell