Is there a better way to compare 2 files and remove duplicates

I want to find a better way to remove computers from a list so commands are not run against them again once they have their results collected in a csv file. Is there a nicer way or better way to do this?

# Compare the Computers.txt and the Results.csv and make a new Computers.txt
# file for only the computers that are not in the Results.csv file.

if (-not (Test-Path -Path “C:\Results.csv”) ) { New-Item -ItemType ‘File’ -Path “C:\Results.csv” }
$Csv = Import-Csv -Path “C:\Results.csv”
$Array = @()
foreach ($Item in (Get-Content -Path “C:\Computers.txt”)) {
if ($Csv.ComputerName -contains $Item) {
#“$Item info has already been collected”
else {
$Array += $Item
if (Test-Path -Path “C:\Computers.txt”) { Remove-Item -Path “C:\Computers.txt” -Force }
$Array | Select-Object -Unique | Sort-Object | Out-File -FilePath “C:\Computers.txt”

Please take a look at the cmdlet Compare-Object. You should read the complete help including the examples to learn how to use it.