February 26th, 2015

PowerTip: Compare Processes with PowerShell

Doctor Scripto
Scripter

Summary: Learn how to compare two processes with Windows PowerShell.

Hey, Scripting Guy! Question How can I use Windows PowerShell to find the differences between two instances of the same process
           running on my system?

Hey, Scripting Guy! Answer Use the Compare-Object cmdlet and specify specific properties to examine, such as cpuidvm, and ws.
            Here is an example that uses two instances of Notepad:

$a = Get-Process -Id 6208

$b = Get-Process -Id 10744

Compare-Object -ReferenceObject $a -DifferenceObject $b -Property cpu, ws, vm, id

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.