0

Anyone know if it's possible to pipe the output of a PowerShell command into a URL request?

I would like to be able to pipe the output to a web server where I can parse out any meaningful data and store it or email it on.

The output is small, so I'm not worried about the finer details like POST limitations and character escaping, etc.

Highdel
  • 67
  • 9
  • see http://stackoverflow.com/questions/13935218/how-to-use-http-get-in-powershell You could use Invoke-Webrequest – realbart Dec 16 '14 at 15:59

1 Answers1

0

It depends on what you want to pipe and what type of HTTP request you want to do.

Invoke-WebRequest supports the following HTTP requests : Delete, Get, Head, Merge, Options, Patch, Post, Put, and Trace.

One caveat is that the only parameter of Invoke-WebRequest which support pipeline input is -Body .

You can check the online help of Invoke-WebRequest for more details :

http://technet.microsoft.com/library/hh849901.aspx

Mathieu Buisson
  • 1,325
  • 10
  • 8