有没有办法从网站导入CSV并在PowerShell中使用它?使用Import-Csv
Cmdlet时,出现以下错误:
$FilePath = "http://sharepoint.com/mydocuments/serverlist.csv"
$serverList = Import-Csv $FilePath -Delimiter ";"
Import-Csv : Cannot find drive. A drive with the name 'http' does not exist.
At line:2 char:15
+ $serverList = Import-Csv $FilePath -Delimiter ";"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (http:String) [Import-Csv], DriveNotFoundException
+ FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.ImportCsvCommand
首先下载CSV:
$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 ";"
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句