DISQUS

DISQUS Hello! Huddled Masses is using DISQUS, a powerful comment system, to manage its comments. Learn more.

Community Page

Huddled Masses

Joel Bennett's development blog...
Jump to original thread »
Author

WGet 2 for PowerShell

Started by Jaykul · 9 months ago

Edit: Added -Passthru

Edit: I made a mistake …
I wrote this a few weeks ago, and made an error in the script which causes it to not work properly with most binary files … I’ve fixed the script down below now, and while I was at it, I went a ... Continue reading »

2 comments

  • I didn't get it to work with FTP sites, but the "fix" is simple, merely change the line

    if($res.StatusCode -eq 200) {

    to

    if($res.StatusCode -eq 200 -or $res.StatusCode -eq "OpeningData") {

    Cheers,
    Niclas
  • I couldn't get it to work specifying a path for the file (and the filename) - I kept getting 'access denied' or the path would be appended to the user home directory.

    I changed:

    if($fileName -and !(Split-Path $fileName))

    to:

    if($fileName -ne $null -and (Split-Path $fileName) -ne $null)

    which worked. I prefer specifying things in this way as I believe they are also easier to read.

    Comments in the script would also have been nice for this of us newer to PS than others!

Add New Comment

Returning? Login