powershell - Get Disk IO performance counter -


i need page faults , disk io of system while particular process running.

i can page faults not able disk io:

 $arraydio = @()  $arraypf = @()  $cmdprocess = start-process cmd -passthru    while (-not $cmdprocess.hasexited) {         $arraydio += %{ (get-wmiobject win32_perfformatteddata_perfproc_process).iowriteoperationspersec }         $arraypf += %{ (get-wmiobject win32_perfformatteddata_perfos_memory).pagefaultspersec }     sleep 2   }  $arraypf | measure-object -average -maximum -minimum | out-file  -filepath c:\details.txt  $arraydio | measure-object -average -maximum -minimum | out-file  -filepath c:\details.txt -append 

rather get-wmiobject, use built-in command getting performance data, get-counter:

get-counter '\process(*)\io data operations/sec'

get-counter '\memory\page faults/sec'


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -