Solved

Post data to a form via Proxy

Posted on 2014-02-24
2
304 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 39

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

How to sign a powershell script so you can prevent tampering, and only allow users to run authorised Powershell scripts
A procedure for exporting installed hotfix details of remote computers using powershell
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now