$task = tasklist /nh /fo csv $total = 0 for($i=0; $i -lt $task.count; $i++) { $one = $task[ $i ].Split(‘"‘).replace(",","")[9].replace(" K","") $total = $total + ([int] $one) } echo ("Total mem usage:{0}MB" -f ($total / 1024))
:没有sed 和awk 就是麻烦。
时间: 2024-10-10 16:01:17