Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Streaming basics - reading large file from RESTful API

$
0
0

Hey all -

My command of PowerShell is pretty rudimentary, though I have written a number of scripts.  In a recent example, I was trying to redirect the output of my firm's RESTful API - a small .txt file - into a file, using | out-file <path and file>.  THat worked 
just fine.  However, when I tried to do this with a docx or pdf file, the result was that I ended up with a small file that was 
unopenable.

I gather what I need to do is stream the content to a file, but I can't quite see how that is done in Powershell.  The files might  be
many MB in size and take upwards of 30 seconds to transfer.

Any basic guidance on how to approach this would be appreciated.  Thanks -

Paul

 


Paul


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>