Solved

Post data to a form via Proxy

Posted on 2014-02-24
2
325 Views
Last Modified: 2014-02-26
I want to be able to submit a webform with some values, however my simple code just says:-
The term 'Invoke-WebRequest' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name,
 or if a path was included, verify that the path is correct and try again.


My code is quite simple, and dont see why it should not work:-
$postParams = @{username='me';moredata='qwerty'}
$test = Invoke-WebRequest -Uri "http://example.com/foobar" -Method POST -Body $postParams -Proxy '172.16.8.11:3128'

Open in new window


Any ideas?

Thank you
0
Comment
Question by:tonelm54
2 Comments
 
LVL 40

Accepted Solution

by:
footech earned 500 total points
ID: 39883272
Are you running PS 3.0 or greater?  That cmdlet was introduced in PS 3.0.
0
 

Author Comment

by:tonelm54
ID: 39888183
You were right, I did upgrade to Powershell 3.0 but now I just get a different error message. Ive opened up a new question under Q_28374722 would you mind looking at it to see where Im going wrong now?

Thank you
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A procedure for exporting installed hotfix details of remote computers using powershell
A brief introduction to what I consider to be the best editor for PowerShell.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question