2 responses to “WGet 2 for PowerShell”

  1. Niclas Lindgren

    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

  2. Paul

    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!