I am reading Don Jones’ book Learning Windows Powershell in a month of lunches and found one nice little sequence of commands which can do a diff between two lists of processes.
Every so often you can get the complaint of “why do these two computers have different run times when they are the same?”
A valid complaint which can take awhile to sort out. Obvious first steps would be to compare apps installed and what is running as sometimes the “smarter then you” engineers can install things without telling anybody.
One quick way would be to use a couple cmdlets and diff. This was taken from page 41.
Use the computer which is running as expected as the reference computer. Get a list of processes by entering:
Get-Process | Export-CliXML reference.xml
The CliXML can hold more information then the traditional CSV file.
After you have the file, you can run:
Diff -reference (Import-CliXML reference.xml) -difference (Get-Process -computername newserver) -property Name
The output centers on the name of each process and you will get <= and => to point out where it’s different.
This is a nice little trick to compare setups. You can keep the reference file as a baseline for future issues on the same computer.
This will work with any of the get cmdlets.