PowerShell Get Memory used by a group of processes
Get the memory usage of a process, grouped, so you get the total. Example; chrome, always have one process per page, use this to get the total of memory used by all of them.
1 2 3 4 5 6 7 8 |
$Processes = get-process chrome,iexplore | Group-Object -Property ProcessName foreach($Process in $Processes) { $Obj = New-Object psobject $Obj | Add-Member -MemberType NoteProperty -Name Name -Value $Process.Name $Obj | Add-Member -MemberType NoteProperty -Name Memory -Value ([decimal]::round((($Process.Group|Measure-Object WorkingSet -Sum).Sum)/1024/1024)) $Obj } |
From Laurent’s comments below, another take on this with the following code, which lists all open processes, with total memory:…