Help comparing strings in csv

I am trying to compare values within a csv. I am taking a csv with device id,description, and location importing the csv then pulling computer description from active directory. I want to compare the 2 descriptions. I am having difficulty with the compare part. The comparison results evaluate to False without exception for both identical and non-identical strings. Can someone please tell me where I am going wrong?

$LDDes = Import-Csv -Path 'somefilepath'

$LDDes | Select-Object 'Device Name','Description',@{Name="AD Description";Expression={$_.'Device Name' | get-adcomputer -Properties Description | Select-Object -ExpandProperty Description}},'Computer Location',@{Name='Match';Expression={$_.Description -eq $_.'AD Desription'}}

you could try it like this:

$LDDes | ForEach-Object {
ADDes = Get-ADComputer -Identity .‘Device Name’ -Properties Description
[PSCustomObject]=@{
‘Device Name’ = _.'Device Name' 'Computer Location' =
.‘Computer Location’
‘Description’ = $.‘Description’
‘AD Description’ = ADDes.Description 'Match' =
.‘Description’ -eq $ADDes.Description
}
}
(untested)

I am on the PowerShell journey myself but here is a suggestion for performance.

You could pipe to ForEach-Object as Olaf illustrates (which can get the job done) - I do use this when needed. If you’re having to process many objects, I would opt for the foreach construct instead.

When using ForEach-Object, each object is generated from the collection, individually, before entering the pipeline, then processed. Multiply this by hundreds or thousands of objects, and it will take a long time.

Generate, process. Generate, process. etc.

When using the foreach construct, all the objects in the collection are generated only once and then processed one at a time. This can be a much faster operation without the overhead of generating individual objects before processing them.

Generate. Process. Process. Process.

Thanks guys, much appreciated. This worked perfectly.