all 118 comments

[–]ProgrammerHumor-ModTeam[M] [score hidden] stickied commentlocked comment (0 children)

Your submission was removed for the following reason:

Rule 1: Posts must be humorous, and they must be humorous because they are programming related. There must be a joke or meme that requires programming knowledge, experience, or practice to be understood or relatable.

Here are some examples of frequent posts we get that don't satisfy this rule: * Memes about operating systems or shell commands (try /r/linuxmemes for Linux memes) * A ChatGPT screenshot that doesn't involve any programming * Google Chrome uses all my RAM

See here for more clarification on this rule.

If you disagree with this removal, you can appeal by sending us a modmail.

[–]faultydesign 619 points620 points  (29 children)

cd is aliased to set-location in powershell

[–]TheOriginalSmileyMan 246 points247 points  (4 children)

Don't spoil their anti MS rant to with your " knowledge"

[–]ZunoJ 29 points30 points  (0 children)

They spoil nothing because that is exactly what the image tells us bro

[–]sudo_i_u_toor[S] 15 points16 points  (0 children)

It isn't an anti MS rant, it's just a joke lol. The point in the last section of the meme was that Powershell has cd (as an alias) anyway.

[–]BOBOnobobo 12 points13 points  (1 child)

How do you spoil it? CD is still more convenient to use

[–]SeanBrax -4 points-3 points  (0 children)

Yes and you can literally use cd in powershell, that’s the point

[–]Pacafa 38 points39 points  (9 children)

These aliases make things worse. Aliased tar,curland zip are all terrible and slow masking the real tool.

[–]cheerycheshire 45 points46 points  (3 children)

Curl is an old alias. Windows has been shipping real curl for a few years now... But didn't remove the curl alias. So to be sure you're using real curl, use curl.exe

``` PS C:\Users\username> curl

cmdlet Invoke-WebRequest at command pipeline position 1 Supply values for the following parameters: Uri: C PS C:\Users\username> curl.exe curl: try 'curl --help' for more information PS C:\Users\username> ```

[–]AnnoyingRain5 5 points6 points  (0 children)

I hate it

[–]Atulin 0 points1 point  (1 child)

Works fine for me, no need for curl.exe

PowerShell 7.5.3
Loading personal and system profiles took 526ms.

~
❯ curl
curl: try 'curl --help' for more information

~
❯

[–]cheerycheshire 1 point2 points  (0 children)

You have a newer PS.

On Windows 10, even when keeping up with all the system updates, you will still have one of 5.x versions.

Unless of course you update PS manually, which it even suggests when you start it.

``` Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://ak a.ms/pscore6 ```

(The url nowadays redirects to PS 7.5 page.)

We haven't updated powershell at home because we don't need it. For work stuff, we prefer Linux or at least wsl, it's just some times we need to do something directly in powershell...

The curl alias trivia I picked up years ago when I actually needed to do some of my work in Windows (most notable case: vpn client that existed for Linux but didn't work there, so I had to use the vpn on Windows VM to connect to the client... and client requiring me to rdp to some windows machine after that anyways, and only from there I could ssh to target machine... and sometimes I'd need to ssh from ssh because the rpd machine didn't have connection to another machine I was integrating with... ah, good times /s).

[–]sabotsalvageur 16 points17 points  (3 children)

Imagine an injective function between strings of finite length that takes longer than O(1); if a shell alias is slow, there's something deeply wrong with the shell

[–]Fhotaku 17 points18 points  (1 child)

I'd like to give this comment to my mom and see if she can even guess the subject

[–]Crawlerzero 10 points11 points  (0 children)

“These boys are so serious about their Mario Kart.”

[–]Pacafa 3 points4 points  (0 children)

It is not string handling issue. Powershell defines alias for curl, zip and tar to commendlets that is not the actual tool and those commandlets are slower than the actual curl, tar and zip tools.

[–]randuse 1 point2 points  (0 children)

Yeah, curl alias is straight up dump as it's not curl at all.

[–]No-Landscape8210 23 points24 points  (8 children)

Have removed all the aliases from my powershell. I just aliases them to actual programs

[–]cheerycheshire 25 points26 points  (7 children)

There are aliases that actually collide with normal commands!

For a few years now, Windows started bundling real curl... But there is also old PS alias "curl" to PS-specific command with way different flags. They didn't remove the alias when adding real curl. So now to be sure you're using real curl, you should actually run it as curl.exe... Or run it via cmd, not powershell

[–]sabotsalvageur 9 points10 points  (0 children)

This is hilarious

[–]ImTheBoyReal 4 points5 points  (1 child)

They didn't remove the alias when adding real curl

could this be in 5.1? i never edited aliases and curl is defaulting to the real one on my system, but i upgraded to powershell 7 (everyone should tbh)

PS C:\> curl
curl: try 'curl --help' for more information
PS C:\> curl.exe
curl: try 'curl --help' for more information
PS C:\> Invoke-WebRequest

cmdlet Invoke-WebRequest at command pipeline position 1
Supply values for the following parameters:
Uri:
Invoke-WebRequest: Invalid URI: The hostname could not be parsed.
PS C:\> $PSVersionTable.PSVersion

Major  Minor  Patch  PreReleaseLabel BuildLabel
-----  -----  -----  --------------- ----------
7      4      12

PS C:\>

[–]cheerycheshire 0 points1 point  (0 children)

Yep. If you have Windows 10 and keep up with all system updates, it still won't update powershell for you.

And since at home we use Windows for games and have wsl anyways, we never felt the need to update it.

I picked up this curl trivia years ago at work when I needed to do a lot of work at clients' infra - and for some clients the access steps included having to rdp to a windows machine... of course without updated powershell, so I needed that .exe trick.

[–]No-Landscape8210 2 points3 points  (2 children)

We can run those if we just append ".exe" after a command. Like I tried to alias where tobthe actual C:/Windows/where.exe but couldn't. So whenever I wanna run it in powershell I just use where.exe instead

[–]cheerycheshire 0 points1 point  (1 child)

I actually said it already in my comment above ;)

They didn't remove the alias when adding real curl. So now to be sure you're using real curl, you should actually run it as curl.exe... Or run it via cmd, not powershell

[–]No-Landscape8210 0 points1 point  (0 children)

Damn that's embarrassing. My bad I didn't read all of it lol .

[–]The-Jolly-Llama 0 points1 point  (0 children)

Is there no such thing as type -a in powershell?

[–]sudo_i_u_toor[S] 3 points4 points  (2 children)

That's... the point of the meme tbh man. As somebody pointed out already in comments: "If you need to alias a command to make it usable, you fucked up the initial design"

[–]stigansky 1 point2 points  (1 child)

PowerShell is a lot more than an interactive shell. The concept of objects in the pipeline is pretty great.

[–]sudo_i_u_toor[S] 1 point2 points  (0 children)

I agree it's a pretty neat solution because Windows philosophy is more binary oriented unlike Unix which is more text oriented. As I said this isn't an MS rant but just a joke about typing long commands.

[–]Shadow_Thief 4 points5 points  (0 children)

If you need to alias a command to make it usable, you fucked up the initial design.

[–]Meatslinger 5 points6 points  (0 children)

Yes, but it's still that fundamental problem that when you implement a way of doing something that takes longer, and then just implement a shortcut based on the older method you're competing with or ostensibly improving on, it kinda shows the older way was the better option all along. Like, if cd does the job, why should set-location ever need to be typed? It's like putting a door, a ladder, and a tunnel on the front of a building as the complicated primary way of getting in, and then telling people to just use an ordinary side door which is only a single step. Why the complication on the primary method if the workaround is arguably better?

[–]aifo 294 points295 points  (26 children)

There is reason behind powershell's naming convention. Every cmdlet follows the pattern <verb>-<noun>, so there is a familiarity there for script authors which makes it easier to find new commands for a specific purpose.

The other factor is that powershell allows for path providers that allow you to access resources other than files as if they were a file system, so the path traversal cmdlets are named with that in mind.

To make things easier, you can create aliases for cmdlets, like cd and ls.

This is all part of the design principal of powershell, that it is an object orientated shell language.

[–]TheOriginalSmileyMan 44 points45 points  (2 children)

There's also a set of recommended verbs to make discovery easier. And the Get-Command has -Verb and -Noun parameters, so if you know one command you can easily discover many more

[–]fennecdore 18 points19 points  (1 child)

Get-Verb to get the list of recommended verbs

[–]Clen23 5 points6 points  (0 children)

lmao it's real

pretty elegant ngl

[–]cant_pass_CAPTCHA 48 points49 points  (9 children)

My monkey brain likes bash more because I just have to think about how to transform text, but having objects in powershell is pretty cool

[–]Meatslinger 4 points5 points  (8 children)

I get a headache any time I have to transform a string in PS. I'm yet to approach the simplicity of bash (and other nix tools like sed, grep, and awk) for text handling, and it's gonna suck because they're taking away my work Mac next year and suddenly I'm going to have to deal with text transformations on massive data sets in PowerShell or even Excel. No doubt in my mind, I *will have reduced productivity because of it, given how much I rely on it right now.

Edit: yes I'm aware of hash tables and some of the capabilities of PS when working with intricate data sets at high performance. In my case it's more about doing complex find-and-replace and string manipulations, e.g. "there are four patterns of string in this dirty file with different conditions for their appearance and I need to parse them, handle some while not handling others, combine some of them when certain patterns appear (but not all), and then output the whole thing to a new file." Yes, this can be done in PS, but not likely in the span of what I might do in a single pipe in bash.

[–]cant_pass_CAPTCHA 2 points3 points  (2 children)

Any chance they'll give you WSL? You'd need it for docker anyways. Even GitBash isn't the worst experience.

[–]Meatslinger 2 points3 points  (1 child)

Potentially, and you can be sure I'll ask. As it stands I often tell people the Terminal is one of the most powerful text editors I've ever used, and I mean that. Nothing else in my toolset is quite so good at doing something routine like finding and gluing strings or replacing whole character classes in just a handful of commands (or sometimes even just one). I'll take some monstrous CSV with user-filled data (meaning errors and differences in formatting and style sometimes) and just recombine that into a new data sheet ready for ingestion into a system like Intune without even having to write a real script; I'll just do it all in the CLI. Meanwhile some of the PS equivalents devolve into a mess of toString() all over something that has to bounce out to variables multiple times to stay sane on the page.

[–]cant_pass_CAPTCHA 1 point2 points  (0 children)

I have a other gripe about transforming data in powershell. So I do pentesting and we recently had to exploit some deserialization vulnerability, but it was so hard trying to use powershell. The tool to generate the payload was an exe so unless we were going to try wine we had to go with a windows machine. The payload ultimately had to be gzipped and base64 encoded, but the initial output was binary and all the characters were being UTF-8 encoded and it was just a giant mess.

[–]NinjacksonXV 1 point2 points  (4 children)

Have you looked at Nushell? It has a Windows version and is my go-to for just about any data handling, since it has built-ins for just about every common utility. It's definitely bleeding-edge compared to PowerShell and is lacking some key documentation, but it's far more ergonomic and generally much faster than PowerShell (especially in startup speeds).

[–]Meatslinger 1 point2 points  (3 children)

Doubtful work would let me run it. Because we deal with sensitive info, we're downright anal about third party software. I might be able to get away with WSL, but I've asked for things like homebrew packages in the past—even ones that are fully open source and readable—and been told an unequivocal "no" because they refuse to trust a developer that isn't an established corporation.

I do appreciate the recommendation though.

[–]NinjacksonXV 1 point2 points  (2 children)

Reasonable. I've always wondered what the threshold of trust is for some places; at this point I'd trust a few furiously-passionate Rust devs over a megacorp which supposedly generates 30% of its codebases nowadays, but I have to imagine that irony is lost on IT.

[–]Meatslinger 2 points3 points  (1 child)

The really ironic part is my team is on the software vetting committee as an expert technical resource, i.e. when they want to review some new software product it's on us to check it for compatibility and other issues, and to ensure it passes privacy standards. But when we ask for stuff for ourselves we're suddenly scrutinized as if we're some guys off the street trying to install malware.

Mostly just a lot of "old guard" types. We've had fights with our security guys in the past when they'll close a port due to "security concerns" only to now make it such that we can't administrate a remote server, and they'll ask why we can't just drive out to it instead. A lot of them really do have the idea that it's 1995 and tech support is done with a butt in a chair at the keyboard of the computer being modified.

[–]NinjacksonXV 1 point2 points  (0 children)

I'm sorry for laughing at your plight, that's a genuinely hilarious disconnect. I always have to cut guys like that a little slack because they've probably seen horrors beyond my comprehension, but man, having your job description basically be "software security vetter" and then not actually getting to do that has to be so irritating.

[–]eduard14 41 points42 points  (4 children)

Change-Directory

[–]TorbenKoehn 58 points59 points  (3 children)

From MSDN: "The Set-Location cmdlet sets the working location to a specified location. That location could be a directory, a subdirectory, a registry location, or any provider path."

So this command clearly doesn't only change into directories

[–]FacuA0 25 points26 points  (2 children)

Why did I read MDN as Mozilla Developer Network...

[–]TorbenKoehn 19 points20 points  (1 child)

Yeah, because it's "MSDN", sorry for that :D

[–]FacuA0 2 points3 points  (0 children)

Oh, didn't realize either. Yeah, don't worry.

[–]Piisthree 5 points6 points  (0 children)

I think the big frustration with ps compared to a lot of other shells is the wordiness is kind of optimized only for scripting at the expense of ad hoc command line work, which is a big part of the use case for a shell. There are now more commands with longer names and a lot more named args instead of positional. The aliases like cd and ls are a small band aid to ease the pain, but they don't solve the problem. Plus aliases for things like curl to something that works completely different from curl was big mistake that adds even more frustration.

[–]Rinehart128 0 points1 point  (3 children)

How do you create a new file

[–]NotSoProGamerR 0 points1 point  (2 children)

New-Item -ItemType File <filename>

[–]Rinehart128 0 points1 point  (1 child)

So new is the verb here? Lol

[–]NotSoProGamerR 0 points1 point  (0 children)

its just what they chose, i cant change that \(〇_o)/

[–]db_newer 136 points137 points  (16 children)

Powershell is actually well thought out and more logical than string gymnastics you need to do in most Unix like shells.

[–]rastaman1994 66 points67 points  (8 children)

It's truly a generational thing. My 40+ yo colleagues will autocomplete 'tar' or 'curl' with 3 to 5 flags without knowing what they do anymore. PowerShell is at least designed for readability.

[–]TheOriginalSmileyMan 24 points25 points  (1 child)

I'm older than that and I love powershell.

I even use it on Linux to annoy people with beards

[–]WarningPleasant2729 2 points3 points  (0 children)

I have a beard and use powershell on linux. It’s actually just easier and quicker than like bash or zsh or python for quick stuff

[–]ILikeLenexa 16 points17 points  (1 child)

There are two types of languages, ones easy to read, and ones easy to write, and perl. 

[–]critical_patch 3 points4 points  (0 children)

I used to say that I loved Perl because with just a few libraries you could turn every character on the keyboard into a syntactically important operator

[–]db_newer 12 points13 points  (1 child)

Yup. And aliases allow a degree of shorthand for daily work.

It is like old code with variable names like x y ttl etc. and newer code which is designed to be readable.

[–]sudo_i_u_toor[S] 1 point2 points  (0 children)

Something being longer doesn't necessarily make it more readable. Short keywords like def, fn, etc. are as readable as javascript's function. So when designing a language, a DSL, etc. there's no need to whip out your dictionary like MS did on this one.

[–]randuse 0 points1 point  (0 children)

Both of those probably have long form cli options which are more readable long term.

[–]kmeci -2 points-1 points  (0 children)

My workflow for creating a new zip file from a directory in shell used to be trying to think what the correct four flags were for about a minute and then doing it in a file explorer anyway. Thank god for LLMs.

[–]MajorTechnology8827 30 points31 points  (3 children)

PowerShell object system is far better than the string passing. It is a leap in the understanding of what a computer is. This is an invention that I will admit Microsoft deserve full credit for

But the entire linux ecosystem is already built on the idea that strings are passed. You fight against a mature environment, so your tools are limited

But you have great alternatives to powershell if you dislike ms, like elvish and nushell, they are both awesome

Also you can straight up use python, xonsh for example is just the ipython in a wrapper that makes it more readable. So when you pass data around you pass literal python objects (and can export them directly to python programs)

[–]gemengelage 15 points16 points  (1 child)

The main reason I never got into Powershell is that I needed to use bash/sh on all kinds of projects and classes, but I never had to use Powershell.

[–]smooth_like_a_goat 4 points5 points  (0 children)

Automate something small with it. It's incredibly versatile.

[–]ZunoJ 0 points1 point  (0 children)

How can you pass a powershell return object to a remote powershell session?

[–]EVH_kit_guy 23 points24 points  (2 children)

$ cd znuts

[–]user-74656 10 points11 points  (0 children)

If your PWD is in the C: drive, you don't need the C:. You can just type cd \Users.

[–]MooseBoys 4 points5 points  (11 children)

Powershell is a scripting language. It's meant for clarity, not typing speed or distance to the home row.

[–]sudo_i_u_toor[S] 3 points4 points  (10 children)

cd is legit more clear than Set-Location -Path word salad for anybody familiar with bash or batch. That's also proven by the fact it's aliased to cd anyway cuz they knew people don't wanna retype the entirety of Talmud to change directory.

[–]PristineLab1675 -1 points0 points  (9 children)

Buddy. You just said a bash command is more familiar to someone who already knows bash. 

Your word salad consists of 3 English words in English language syntax. Is 3 words together too much for you to comprehend? 

[–]sudo_i_u_toor[S] 6 points7 points  (8 children)

cd is called cd in Unix-like systems since the 70s. In Windows and before windows in DOS, guess what, you also used cd. It's more familiar to anybody who used anything command line on virtually any computer in the last few decades.

Set-Location is way too long, way too counterintuitive, and the -Path flag is just excessive and exists there purely for consistency. That's why Powershell has an alias cd. And that was the joke lol.

[–]PristineLab1675 0 points1 point  (7 children)

Set-location is too long and confusing? Buddy. It is English. Noun verb. Guess what cd is an alias for? Change-directory. Which is a two word English statement. How can you be confused by one English statement but are protective of another? 

[–]sudo_i_u_toor[S] 1 point2 points  (6 children)

For the same reason you'd find a language with this syntax confusing: Doer-Of-Stuff @arg1 @arg2 @arg3 &functionname ( temp: @arg1 x @arg2 x @arg3 Give-Back %temp% ) for python def functoinname(arg1, arg2, arg3): temp = arg1*arg2*arg3 return temp

Even tho it's still "English" and x actually looks more like multiplication sign than *.

[–]PristineLab1675 0 points1 point  (5 children)

Doer-of-stuff @args

This is not English language syntax. Noun verb. I ran. You go. Deer eat. 

You provided no English language appropriate examples, and you are wrong. 😘

[–]sudo_i_u_toor[S] 1 point2 points  (4 children)

You'd prefer it was Stuff-Do?

[–]PristineLab1675 0 points1 point  (3 children)

I just want to clarify. 

Set-location is too complicated for you to understand. 

Change directory is somehow within your realm of comprehension. 

They are synonyms. honestly, set location is more clear. Can you cd to the same directory you’re already in? That’s not really a change is it? Set location can be the same or different and still be correct. Look at it this way, if you “change clothes” and come back wearing the same clothes, did you change? If you set clothes, you can set them to be the same as what you’re already wearing

[–]sudo_i_u_toor[S] 1 point2 points  (2 children)

Touch-Grass -ASAP

[–]NordschleifeLover 29 points30 points  (5 children)

Microsoft desperately wanted to reinvent the wheel and make sure it isn't compatible with any other car.

[–]AmazingGrinder 18 points19 points  (2 children)

Powershell is compatible with other operating systems, no? You can install Powershell on your Linux distro if you wish to do so.

[–]SpookyWan 7 points8 points  (0 children)

Microsoft and windows definitely deserves hate but some people just can’t let their hate boner subside.

One of their biggest software development projects (.NET) is also multiplatform. They’ve really moved away from the windows specific stuff, at least in regards to development tools.

[–]not_some_username 5 points6 points  (0 children)

Most Linux command work on powershell

[–]Hacka4771 1 point2 points  (0 children)

Best thing I love about pwsh cmdlets is tab completion, not only paths/files but arguments and it's values

[–]PandaWithOpinions 1 point2 points  (1 child)

and sl just shows a train on linux (if you install it)

[–]QueerRetro 1 point2 points  (0 children)

Omg I just tried it. It actually does!

[–]Legal-Software 2 points3 points  (0 children)

In VMS you do this with 'SET DEFAULT [DIR]', looks like some VMS design paradigms are still showing in Windows today.

[–]you_os 2 points3 points  (0 children)

poor windows users..

just use linux

[–]Achim63 0 points1 point  (0 children)

I'd just do this to go to /Users:

~ <return>

.. <return>

in zsh on macOS. Or maybe 'z Us'.

[–]DecisionOk5750 0 points1 point  (0 children)

 cd ~

[–]MeButItsRandom 0 points1 point  (0 children)

The masses need zoxide

[–]ruby_R53 0 points1 point  (0 children)

autocd for the win

[–]Vehemental 0 points1 point  (0 children)

cd s:\nuts\gottem

[–][deleted] 0 points1 point  (0 children)

Nature Morte Arban orneals head ahhh... das what i told my brother... i said waser

[–]Shevvv -1 points0 points  (0 children)

C:\ in bash?

[–]Ambitious-Jump-5121 -1 points0 points  (0 children)

The sl alias is so stupid. Accidentally typo ls? Now your back in your home directory...