$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 就是麻烦。
$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 就是麻烦。