How do I test that each item in CSV 1 exists in CSV 2?

Hello, I have two lists of names that I need to compare and return True if every item in $CSVobj1 equals $CSVobj2

I can return results with compare-object, but I need to return True if Item1 and 2 exist in CSVobj2. And False if only Item1 exists in CSVobj2.

Any help would be appreciated.

#Here are my two CSV files as an example

$CSVobj1 = @(
  [pscustomobject]@{
  List1 = 'Item1'
  }
  [pscustomobject]@{
  List1 = 'Item2'
  }
  )
$CSVobj2 = @(
  [pscustomobject]@{
  List1 = 'Item1'
  }
  [pscustomobject]@{
  List1 = 'Item2'
  }
  [pscustomobject]@{
  List1 = 'Item3'
  }
  )

$CSVobj1 | Export-Csv -LiteralPath "Path"
$CSVobj2 | Export-Csv -LiteralPath "Path"

#I import my CSV files

$RefCSV = Import-Csv -Path "Path"
$DifCSV = Import-Csv -Path "Path"

# I can get results from compare-object
Compare-Object $RefCSV $DifCSV -IncludeEqual -PassThru

List1 SideIndicator
----- -------------
Item1 ==           
Item2 ==           
Item3 =>    

$splat = @{
    ReferenceObject = $CSVobj1 
    DifferenceObject = $CSVobj2
    Property = 'List1'
    IncludeEqual = $true
}

Compare-Object @splat | Select-Object List1,SideIndicator,
@{n='Exists';exp={If($_.SideIndicator -eq '=='){$true}Else{$false}}}

List1 SideIndicator Exists
----- ------------- ------
Item1 ==              True
Item2 ==              True
Item3 =>             False

Thanks! Great example on how to add a third column to compare-object. To get the boolean result I was looking for to pass the test as a whole, I decided to count the “True’s” in the Exists column.

$Count = $compareObject.Exists -eq 'True' | measure

Count    : 2
Average  : 
Sum      : 
Maximum  : 
Minimum  : 
Property : 

$count.count -eq '3'
False