Stories
Slash Boxes
Comments

SoylentNews is people

posted by cmn32480 on Tuesday August 23 2016, @10:58AM   Printer-friendly
from the parts-of-the-basic-toolset dept.

Well, that didn't take long: within a week of applause for Microsoft's decision to open-source PowerShell, a comment-war has broken out over curl and wget.

For those not familiar with these commands: they're open source command line tools for fetching Internet content without a browser. Apart from obvious applications like downloading whole sites (for example as backup), they're also under the hood for a lot of other toolsets (an example the author is familiar with – GIS tools use curl and/or wget to fetch maps from Web services).

For some reason, Microsoft's team decided to put aliases for curl and wget in Windows PowerShell – but, as this thread begins, those aliases don't deliver curl and wget functionality.

The pull request says the aliases should be spiked: "They block use of the commonly used command line tools without providing even an attempt to offer the same functionality. They serve no purpose for PowerShell users but cause confusion and problems to existing curl and wget users."

http://www.theregister.co.uk/2016/08/23/your_wget_is_broken_and_should_die_powershellers_tell_microsoft/

-- submitted from IRC


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 2) by NCommander on Tuesday August 23 2016, @11:19AM

    by NCommander (2) Subscriber Badge <michael@casadevall.pro> on Tuesday August 23 2016, @11:19AM (#392068) Homepage Journal

    This is a very annoying problem when it happens because as far as I can tell, in PS, there's no way to walk the PATH to find the actual binary to override the alias. The last time I needed to work with wget in a PowerShell script, I had to hardcode in the path to wget vs just letting it be found on the path. There are a bunch of other aliases in powershell, but off the top of my head, only wget and curl are actual commands vs. shell functionality.

    --
    Still always moving
    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2  
  • (Score: 5, Interesting) by jimshatt on Tuesday August 23 2016, @12:49PM

    by jimshatt (978) on Tuesday August 23 2016, @12:49PM (#392087) Journal
    While 'wget' is an alias for 'Invoke-WebRequest' which you cannot override, you *can* create an alias for 'Invoke-WebRequest' so that it invokes the real wget binary. This is, however, *very* evil. Now, wget will work as expected, but Invoke-WebRequest will also work as wget, which WILL break other scripts. But, yeah, whatever.

    PS: Muhuhuhahaha
  • (Score: 3, Interesting) by martyb on Tuesday August 23 2016, @12:56PM

    by martyb (76) Subscriber Badge on Tuesday August 23 2016, @12:56PM (#392090) Journal

    I do not have any experience with PowerShell, but noticed in the discussion thread a couple of possible work-arounds.

    Work-around #1: user jpsnover [github.com] suggfested this work-around [github.com]:

    THIS IS NOT A FIX - but if you want to get rid of them for now, you can just add the following to your profile:

    Remove-Item Alias:Curl
    Remove-Item Alias:WGet

    Work-around #2: User kilasuit [github.com] suggested this workaround [github.com]:

    Though if your writing a script to be used on someone elses machine you can place any code like

    cd Alias:\ ; Remove-item curl,wget

    Right at the beginning of the script which stops the issue.

    Can anyone here confirm?

    --
    Wit is intellect, dancing.
    • (Score: -1, Troll) by Anonymous Coward on Tuesday August 23 2016, @01:38PM

      by Anonymous Coward on Tuesday August 23 2016, @01:38PM (#392112)

      Yes well I have used PowerShell, and the correct solution if you insist on using wget instead of System.Net.WebClient is to bundle your own copy of wget.exe with your script and invoke it explicitly.

      .\wget.exe

      See? Is that so fucking hard?

      Oh shit no, now I'm going to be burned at the stake by penguin loving linux scum because I've used PowerShell.

      • (Score: 3, Insightful) by tangomargarine on Tuesday August 23 2016, @01:44PM

        by tangomargarine (667) on Tuesday August 23 2016, @01:44PM (#392116)

        You refer to us as "penguin loving linux scum" and then are surprised when people take offense? Shocking news: when you're rude to people they're often rude back.

        --
        "Is that really true?" "I just spent the last hour telling you to think for yourself! Didn't you hear anything I said?"
        • (Score: -1, Flamebait) by Anonymous Coward on Tuesday August 23 2016, @01:53PM

          by Anonymous Coward on Tuesday August 23 2016, @01:53PM (#392122)

          Two points:

          (2)Why do you feel the overwhelming urge to join an exclusive club that uses only Linux? I use Linux and Windows equally because I'm not a goddamned bigoted asshole like so many poser geeks who are too fucking stupid to use more than one thing.

          (2) Dude bro like where's my fucking tolerance and shit? Why nerds gotta be hating on nerds? Don't you get enough abuse from normals already?

          • (Score: 0) by Anonymous Coward on Tuesday August 23 2016, @02:11PM

            by Anonymous Coward on Tuesday August 23 2016, @02:11PM (#392126)

            Windows is great for some things, like developing GUI desktop applications that run only on Windows.

            The second thing it's good for is...

            Let me think about that one.

            • (Score: 0) by Anonymous Coward on Tuesday August 23 2016, @02:39PM

              by Anonymous Coward on Tuesday August 23 2016, @02:39PM (#392143)

              Getting viruses! Oh you mean GOOD things it's good at. I'll get back to you

              • (Score: 2) by Azuma Hazuki on Tuesday August 23 2016, @04:07PM

                by Azuma Hazuki (5086) on Tuesday August 23 2016, @04:07PM (#392192) Journal

                It's good for booting up on a new machine so you can download a Linux or BSD iso and burn it. Give credit where credit is due :)

                --
                I am "that girl" your mother warned you about...
                • (Score: 3, Interesting) by edIII on Tuesday August 23 2016, @06:10PM

                  by edIII (791) on Tuesday August 23 2016, @06:10PM (#392223)

                  If we're going to be fair, the asshole has a point. There is a way to make it work, and it is better (from a certain point of view) to be able to use as many tools and platforms as possible to get the job done. I can appreciate that attitude of agnosticism, although he shrugged it off just as fast as he put it on.

                  What I can't appreciate is that Microsoft attempted to bridge the gap, and then fucked it all up. There isn't a reason to go through the hoops of explicitly calling wget at all. Microsoft should have implemented both of those programs fully, with special attention at making it as consistent with Linux use as possible.

                  Of course, I take all of that with a grain of salt giving the inconsistencies between same named binaries within Linux and BSD platforms too. A lot of times those are simply missing flags, but that is different behavior on different platforms. Honestly, I wouldn't of singled out Microsoft at all if I find the problem, because it exists elsewhere outside of Microsoft.

                  They're trying at least. It's a moot point of course with everything else going on (TELEMETRY FUCK YOU!!). What's ironic is that somebody suggested to me that I use Powershell for a mini-project and I told them I wasn't willing to invest the time to figure out all the differences and eccentricities when I could be focusing on learning BSD better, and working with anti-MS platforms like ReactOS and PCBSD. Both wget and curl would have fucked me up for a few minutes.

                  Ultimately, working with Microsoft at all will become self-defeating IMHO. It's not like they're going in a different direction, but full steam ahead to Walled Garden'd telemetry and full NSA/FBI surveillance of all users, all the time. Shit, even Apple is putting up more of a fight against the government and loss of privacy.

                  Interesting Times, but if you're using PowerShell and committed to the Windows platform, you've already bent over and accepted to the big ol' lubed up M I C R O S O F T and a complete utter lack of privacy, control, and IMHO, dignity. Agnosticism left the building after Microsoft started forcefully backporting telemetry and removing individual patches.

                  --
                  Technically, lunchtime is at any moment. It's just a wave function.
                  • (Score: 0) by Anonymous Coward on Tuesday August 23 2016, @09:08PM

                    by Anonymous Coward on Tuesday August 23 2016, @09:08PM (#392305)

                    I agree that if Microsoft had properly implemented wget and curl, with rigorous compatibility testing, there would be no issue. Anyone should be able to implement those commands.

                    The problem is that they couldn't be bothered doing that.

                  • (Score: 2) by art guerrilla on Tuesday August 23 2016, @10:33PM

                    by art guerrilla (3082) on Tuesday August 23 2016, @10:33PM (#392351)

                    pedant alert:
                    i would not have...
                    vs
                    i would not of...
                    sorry, the fingers move of their own volition sometimes...

                    • (Score: 2) by edIII on Tuesday August 23 2016, @10:46PM

                      by edIII (791) on Tuesday August 23 2016, @10:46PM (#392355)

                      Don't apologize! :)

                      I wish that my grammer were better all the time ;)

                      --
                      Technically, lunchtime is at any moment. It's just a wave function.
                      • (Score: 2) by art guerrilla on Saturday August 27 2016, @09:05PM

                        by art guerrilla (3082) on Saturday August 27 2016, @09:05PM (#394038)

                        i thank a couple online denizens who corrected my misuse of 'soupcon' and misspelling of 'smorgasbord'...
                        a lot of obvious stuff just goes by in the stream (not worth the effort to 'correct' their/there/they're, etc mixups), but some of them catch the eye...
                        later, ed ed ed...

        • (Score: 2) by zeigerpuppy on Wednesday August 24 2016, @12:46AM

          by zeigerpuppy (1298) on Wednesday August 24 2016, @12:46AM (#392389)

          I'll happily admit to fornicating with flightless birds (in a grimy way) If it means I don't have to put up with Windows dragging down the computing paradigm to the lowest common idiot.
          Here, beaky, it's time for our afternoon tryst...

    • (Score: 2) by jimshatt on Tuesday August 23 2016, @03:26PM

      by jimshatt (978) on Tuesday August 23 2016, @03:26PM (#392169) Journal
      That does indeed work. I tried setting the alias to something else with Set-Alias, which gives an error. Removing it with 'del Alias:wget' does work and if you have wget on the PATH, that will get picked up. If you have existing scripts that expect wget to behave like Invoke-WebRequest, they will be broken, so I would remove the aliases at the start of your scripts when you intend to use them.
    • (Score: 5, Funny) by DannyB on Tuesday August 23 2016, @04:50PM

      by DannyB (5839) Subscriber Badge on Tuesday August 23 2016, @04:50PM (#392209) Journal

      Clippy: It looks like you are trying to work around Microsoft's deliberately broken curl and wget. Would you like me to install Windows 10 for you? Please do any of the following to install Windows 10: Click Yes, No, Cancel, the X in the title bar, or pull the power cord from the wall outlet to have Windows 10 conveniently installed on the next reboot.

      --
      To transfer files: right-click on file, pick Copy. Unplug mouse, plug mouse into other computer. Right-click, paste.