Get-Process with total memory usage

Format-Table can show expressions and auto-size the columns to fit the results:

On 64 bits:

get-process -computername $tag1 | Group-Object -Property ProcessName | 
    Format-Table Name, @{n='Mem (KB)';e={'{0:N0}' -f (($_.Group|Measure-Object WorkingSet64 -Sum).Sum / 1KB)};a='right'} -AutoSize

On 32 bits:

get-process -computername $tag1 | Group-Object -Property ProcessName | 
    Format-Table Name, @{n='Mem (KB)';e={'{0:N0}' -f (($_.Group|Measure-Object WorkingSet -Sum).Sum / 1KB)};a='right'} -AutoSize

Get-Process | Select-Object Name,@{Name='WorkingSet';Expression={($_.WorkingSet/1KB)}}

Tags:

Powershell