Import-CSV is blank and empty


my csv looks this

name,address
dave,dave@dave.com
dave,dave2@dave.com
dave,dave3@dave.com

i've stored on c:drive, called 'alias.csv' , ran command:

ps c:\>import-csv "alias.csv" | foreach {set-mailbox $_.name -emailaddresses @{add=$_.address}}

it goes straight flashing cursor.

but addresses not listing.

i can add them individually no problem @ all.

set-mailbox dave -emailaddresses @{add="dvealias@dave.com"}

this works fine i'm thinking there must wrong csv.  try command:

get-childitem 'alias.csv' | foreach {      $check = import-csv $_      if ($check) { write-host "$($_.name) contains data" }      else { write-host "$($_.name) not contain data" }  }

and comes

does not contain data

every time....it's not reading csv @ all.  if this:

ps c:\> get-content alias.csv

it lists contents of csv!!

why import not working? 

it worked yesterday lol

thanks!

* tried on pc , it's working.  must powershell.

if following, data come back?

import-csv "alias.csv"

also, since specifying file name, in same directory script in?


if find post has answered question, please mark answer. if find post helpful in anyway, please click vote helpful.




Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

some help on Event 540

WMI Repository 4GB limit - Win 2003 Ent Question

Event ID 1302 (error 1307) DFS replication service encountered an error while writing to the debug log file