Name,eMail,Account
Hans Muster,hans.muster@gmail.com,hmuster
Frauke Peters,frauke.peters@hotmail.com,fraukepeters
Hugo Schönbächler,teh_hugo@gmail.com,teh_hugo
Notice, the data is separated by commas (,), not semicolons, not tabs. This is relevant!
Then save the csv as eg. C:\temp\users.csv.
Now comes the powershell script:
$csv = Import-Csv C:\temp\users.csv foreach ($line in $csv) { $name = $line.Name $mail = $line.eMail $account = $line.Account }
Inside the brackets { } you put your script after the variables you defined in the first lines. Done.
No comments:
Post a Comment