Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Windows 7 Forum Vista Tutorials Tags

Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Import-CSV from Web/Variable

Reply
 
LinkBack Thread Tools Display Modes
Old 08-08-2007   #1 (permalink)
Luke
Guest


 
 

Import-CSV from Web/Variable

At the moment, the import-csv command only allows for importing a local CSV
file (at least to my knowledge). However, I need to be able to pull a file
off the web (using a System.Net.WebClient object) and then import that data
straight into PS. I've tried passing data into a variable first and using
"variable = [csv]data" (the latter turned out to only work for XML). Is there
any sort of advanced method I'm missing out on or is this just impossible at
the moment?

My System SpecsSystem Spec
Old 08-08-2007   #2 (permalink)
Marco Shaw
Guest


 
 

Re: Import-CSV from Web/Variable

Luke wrote:
> At the moment, the import-csv command only allows for importing a local CSV
> file (at least to my knowledge). However, I need to be able to pull a file
> off the web (using a System.Net.WebClient object) and then import that data
> straight into PS. I've tried passing data into a variable first and using
> "variable = [csv]data" (the latter turned out to only work for XML). Is there
> any sort of advanced method I'm missing out on or is this just impossible at
> the moment?


Check this out as an example:
http://powergadgets.com/csPg/forums/thread/185.aspx

Marco
My System SpecsSystem Spec
Old 08-09-2007   #3 (permalink)
Luke
Guest


 
 

Re: Import-CSV from Web/Variable

Thanks! I've thought of using a temporary file previously but didn't want to
bother with generating a temp file name myself, but the
"[System.IO.Path]::GetTempFileName()" method's much better.

"Marco Shaw" wrote:

> Luke wrote:
> > At the moment, the import-csv command only allows for importing a local CSV
> > file (at least to my knowledge). However, I need to be able to pull a file
> > off the web (using a System.Net.WebClient object) and then import that data
> > straight into PS. I've tried passing data into a variable first and using
> > "variable = [csv]data" (the latter turned out to only work for XML). Is there
> > any sort of advanced method I'm missing out on or is this just impossible at
> > the moment?

>
> Check this out as an example:
> http://powergadgets.com/csPg/forums/thread/185.aspx
>
> Marco
>

My System SpecsSystem Spec
Reply

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Variable and deepcopy BatchMan PowerShell 1 05-15-2008 02:28 PM
browser variable berthiau Vista file management 0 09-23-2007 10:54 PM
Set-Variable Fred J. PowerShell 3 10-25-2006 12:39 PM
tab and variable hn PowerShell 8 10-20-2006 06:40 AM
How can I ensure that a variable is a built-in powershell variable? Sung M Kim PowerShell 7 09-22-2006 06:28 PM


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53