I have this code:
$Read1=Import-Csv"U:\reports\ad\test.csv"
$GetDepartment=$Read1.Department
$GetDesc=$Read1.DepartmentDesc
$GetMail=$Read1.email
foreach ($emailin$GetMail) { $email.remove($email.indexof("@"))}
$email
it works and I can read the emails from the file. I have 4 different records and emails in the file. The output looks like this:
user1
user2
user3
user4
user4@acme.org
It adds the @acme.org on the last record each time. Why? I've tired adding single and double quotes around the record in Excel but that did not help.