penfold Posted June 30, 2016 Posted June 30, 2016 I have a csv file which I am trying to read which contains very basic information but when I assign variables it only seems to assign the first of them. I have Name, Account Name, ID as headers for the csv file and when I use import-csv I can assign the Name& AccountName but if I try it with ID it shows blank. I'm using ... foreach ($row in $check) { $name = $row.Name $Samaccount = $row.AccountName $id = $row.ID ...} but if I try and reference $id it shows empty. I'm not sure why it would work for Name but not for ID. Any ideas?
penfold Posted June 30, 2016 Author Posted June 30, 2016 OK ignore me. I think I just realised that I had an additional Foreach loop in which shouldn't have been there.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now