Contact Info

Crumbtrail

ActiveXperts.com » Administration » Powershell » Powershell 1.0 » Compare-Object

Compare-Object - Powershell 1.0 CmdLet

ActiveXperts Network Monitor ships with integrated Powershell scripts to monitor complex network. The scripts run out of the box
Download the ActiveXperts Network Monitor FREE version now »

Compare-Object

Description
Compare the properties of objects

Usage


Options


Example(s)
Compare the content of two text files:

PS C:\>compare-object -referenceobject $(get-content C:\file1.txt) $(get-content C:\file2.txt)

Compare the processes running before and after starting a copy of notepad.exe, using Get-Process to retrieve the processes running and store them in a variable:

 PS C:\>$proc_before = get-process
 notepad
 $proc_after = get-process
 compare-object -referenceobject $proc_before -differenceobject $proc_after