header image

Process information

Posted by: | September 11, 2011 | No Comment |

Recent forum question got me thinking about retrieving process information. In this case it was about a processes Working Set

 

Standard response is

PS> Get-Process powershell | select *working*

MaxWorkingSet    : 1413120
MinWorkingSet    : 204800
PeakWorkingSet   : 50548736
PeakWorkingSet64 : 50548736
WorkingSet       : 49737728
WorkingSet64     : 49737728

 

We could go WMI

 

PS> Get-WmiObject -Class Win32_Process -Filter "Name=’Powershell.exe’" | select *working* | fl

MaximumWorkingSetSize : 1380
MinimumWorkingSetSize : 200
PeakWorkingSetSize    : 49364
WorkingSetSize        : 49811456

 

The results are the same but the units have changed.

 

Our final choice is to go directly for the performance counters

 

PS> Get-Counter -Counter "\Process(powershell)\Working Set Peak", "\Process(powershell)\Working Set", "\Process(powershell)\Working Set – Private"

Timestamp                 CounterSamples
———                 ————–
11/09/2011 15:32:10       \\rslaptop01\process(powershell)\working set peak :
                          50548736

                          \\rslaptop01\process(powershell)\working set :
                          47411200

                          \\rslaptop01\process(powershell)\working set – private :
                          19300352

under: PowerShellV2