• Elvith Ma'for@feddit.org
    link
    fedilink
    English
    arrow-up
    40
    ·
    edit-2
    2 days ago

    Microsoft just set a system wide default alias in Powershell for Invoke-WebRequest called curl.

    While I get their reasoning for that (I mean, they also aliased e.g. ls and dir to Get-ChildItem which is the same, but way more powerful than the OG commands the aliases hint at), the problem is, that in all those cases the arguments don’t match. Something that plays in the favor of Powershell is that arguments are not case sensitive and do not need to be written in full, as long as they’re distinct - e.g. -Force may be abbreviated -f as long it’s the only argument starting with f. While dir or ls is somewhat likely to be called without arguments (or maybe -f) that’s definitely not the case for curl.

      • Elvith Ma'for@feddit.org
        link
        fedilink
        English
        arrow-up
        12
        ·
        1 day ago

        Yes. Somewhat. In Powershell dir is an alias for Get-ChildItem.

        While dir . or dir C:\test\ works as expected, you could also do this: dir HKLM:\HARDWARE -Recurse -Depth 5 which will list your registry from the local machine from the key HARDWARE recursively - but only to a depth of 5 levels.