Quantcast
Viewing all articles
Browse latest Browse all 34890

PowerTip: Use PowerShell to Easily Compare Running Processes

Summary: Use Windows PowerShell to easily compare running processes on local or remote computers.

Image may be NSFW.
Clik here to view.
Hey, Scripting Guy! Question
 How can I compare running processes on my local computer or on two remote computers? 

Image may be NSFW.
Clik here to view.
Hey, Scripting Guy! Answer
 Use the Get-Process cmdlet to retrieve running process information (this can be used remotely). Store the results in a variable.
Do the same thing again against other computers or against the local computer after things have possibly changed.
Then use the Compare-Object cmdlet to compare the two objects. 

PS C:\> $a = Get-Process

PS C:\> notepad

PS C:\> $b = Get-Process

PS C:\> Compare-Object -ReferenceObject $a -DifferenceObject $b -Property name

name                                       SideIndicator

----                                       -------------

notepad                                    =>

SearchProtocolHost                         <=

 

Image may be NSFW.
Clik here to view.

Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 34890

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>