Powershell script to find unique values in two sets

Powershell script to find unique values in two sets

March 3, 2020

You can use a simple PowerShell script to find which values in two sets are unique to each set. 

 

Define each set of comma separated values: 
$set1 = "chicago","boston","baltimore"

$set2 = "detroit","boston","philadelphia"

 

Then use the Compare-Object command to analyze the sets:

Compare-Object $set1 $set2

 

 

PowerShell will generate a list showing just those values that are not in both sets. 

 

 

 

Please reload

Contact Me With Your Litigation Support Questions:

seankevinoshea@hotmail.com

  • Twitter Long Shadow

© 2015 by Sean O'Shea . Proudly created with Wix.com