Run at "Windows PowerShell ISE":
“Windows PowerShell” 不会自动刷新数据。
while ($true) { get-process iexplore | Sort WS -Descending | Select-object -First 1 | select-object @{Label="RunTime";Expression={$(Get-Date)}} ,@{Label="Memory(MB)";Expression={[int]($_.PrivateMemorySize/1024/1024)}}, Name, StartTime ; start-sleep -s 5 }
RunTime Memory(MB) Name StartTime
------- ---------- ---- ---------
6/8/2020 6:11:25 PM 6 iexplore 6/8/2020 6:11:24 PM
6/8/2020 6:11:30 PM 13 iexplore 6/8/2020 6:11:24 PM
6/8/2020 6:11:35 PM 89 iexplore 6/8/2020 6:11:25 PM
6/8/2020 6:11:44 PM 96 iexplore 6/8/2020 6:11:25 PM
6/8/2020 6:11:49 PM 97 iexplore 6/8/2020 6:11:25 PM