Here is how we can get information in a csv file format using Export-CSV command.
Get-ADComputer -Filter { name -like “*searchString*”} | select Name | Export-CSV c:\temp\filename.csv
Once we have the csv file the best command to read eventually this information is not Get-Content but Import-CSV. Import-CSV reads the individual entries in CSV file and keeps it as an object. So we have to use the format object.atribute to read the value, e.g. as the column header of my csv file is Name, I can read the csv file using that attribute.
ForEach ($Computer In $Computers){Write-Host $Computer.Name}