Thursday, 15 March 2012

Powershell Import-CSV from SharePoint -



Powershell Import-CSV from SharePoint -

is there way import csv website , utilize in powershell? import-csv cmdlet error:

$filepath = "http://sharepoint.com/mydocuments/serverlist.csv" $serverlist = import-csv $filepath -delimiter ";" import-csv : cannot find drive. drive name 'http' not exist. @ line:2 char:15 + $serverlist = import-csv $filepath -delimiter ";" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + categoryinfo : objectnotfound: (http:string) [import-csv], drivenotfoundexception + fullyqualifiederrorid : drivenotfound,microsoft.powershell.commands.importcsvcommand

download csv first:

class="lang-powershell prettyprint-override">$filepath = "http://sharepoint.com/mydocuments/serverlist.csv" $localpath = "c:\temp\serverlist.csv" $wc = new-object system.net.webclient $wc.downloadfile($filepath, $localpath) $serverlist = import-csv $localpath -delimiter ";"

powershell csv import

No comments:

Post a Comment