SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Retrieve file from web


Retrieve file from web

Author
Message
sqldriver
sqldriver
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2078 Visits: 2536
Hello,

I've exhausted myself trying to get this to work with cURL, and am trying to get it to work with PS v3 now. I've stitched together code from a couple places and come up with this:


$formFields = @{sendusername='user';password='pass'}
invoke-webrequest “http://www.ims-dm.com/cgi/download2.php?productid=WIREFTPM”| -Method Post -Body $formFields select -exp links|where{$_.href -like "*.zip"}|select -exp href|foreach{start-bitstransfer $_ C:\SurveyComputing}



Which results in this:

-Method : The term '-Method' 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.
At line:1 char:81
+ ... tid=WIREFTPM”| -Method Post -Body $formFields select -exp links|where{$_.href -l ...
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (-Method:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException


The cURL issue I was running into was something with the URI of the website being obscured by a .php or Java redirect. Not sure if I'll have the same issue with PS, but I'd like to give something else a try.

Any suggestions or pointers are appreciated.

Thanks
sqldriver
sqldriver
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2078 Visits: 2536
If there's anything else I can provide to help you help me, let me know!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search