我正在尝试获取MSMQ队列中的所有请求,而不是每个人,但总数。
PS C:\ Users \ mhall> gwmi -class Win32_PerfRawData_MSMQ_MSMQQueue | ft -prop MessagesInQueue
.curveLinear
答案 0 :(得分:1)
试试这个:
Get-WmiObject -Class Win32_PerfRawData_MSMQ_MSMQQueue |
# sum values from MessagesInQueue
Measure-Object -Sum MessagesInQueue |
# remove header
Select-Object -ExpandProperty Sum
答案 1 :(得分:0)
稍微简化的替代方案:
(Get-WmiObject Win32_PerfRawData_MSMQ_MSMQQueue | Measure-Object -Sum MessagesInQueue).Sum