Syntactically, I don't think there are any errors. But, if you unwind that wad of code you get this:
$emailAddresses = Get-Content C:\input\list.csv
ForEach ($emailAddress in $emailAddresses) {
Get-ADUser -Filter { mail -like $emailAddress } -Properties * |
Select-Object DisplayName,GivenName,Surname,SamAccountName,EmailAddress,Userprincipalname,
title,Office,description,DepartmentNumber,employeeNumber,employeeType,manager |
Select-Object Surname,GivenName,DisplayName,SamAccountName,EmailAddress,Userprincipalname,
title,Office,employeeNumber,employeeType,description,co,personalTitle,
@{Name='DepartmentNumber';Expression={[string]::join(";", $($_.DepartmentNumber))}},
@{name='Manager';expression={$_.manager -match '(?<=CN=).+?(?=,)' | Out-Null; $Matches.Values}} |
Export-csv C:\temp\output.csv -Notypeinformation -Append
}
Which would be easier to decipher. I don't understand why there are two Select-Object cmdlets, though.
Also, the regex to extract the manager's CN value may surprise you if there is an escaped comma in the CN (e.g., "CN=Jones\, John,".
It would also help if you stated what error you are encountering.