r/programminghumor • • 18d ago

If

Post image
759 Upvotes

74 comments sorted by

221

u/PlanetVisitor 18d ago • Mindblown

RemoveData Data-Files FromStorageDevice /force /recursive -Drive C -Drive D

105

u/KatAirlines 18d ago

powershell commands looking like my ssh key passphrases

52

u/spektre 17d ago • Mindblown
Set-FileSystemItemLifecycleState `
    -LiteralPath '\\localhost\C$\path' `
    -DesiredState ([Microsoft.PowerShell.Management.ItemState]::Absent) `
    -CredentialScope CurrentUser `
    -AuthenticationMethod Negotiate `
    -Recurse:$true `
    -Force:$true `
    -AllowIrreversibleOperation:$true `
    -WhatIf:$false `
    -Confirm:$false `
    -ErrorAction Stop `
    -PassThru | Out-Null

28

u/Vladislav20007 17d ago

what the actual fuck are microsoft devs doing

23

u/spektre 17d ago • Bravo

Crack cocaine.

5

u/NoResolution6245 14d ago

-CrackCocaine

3

u/Dapper_Librarian388 13d ago

-CrackCocaine:$true

2

u/APariahsPariah 17d ago

Looks more like krocodil to me.

4

u/locri 17d ago

They're from a generation that believe more code/syntax means more job security.

Literally anyone can get into Linux and so everything is literate and simple af.

1

u/RapsyJigo 14d ago

It's actually a lot better for people who weren't around when the bash of olde was written. Now not everything is better but having things verbose is a ton better for humans

10

u/APariahsPariah 17d ago

It's shit that like this that makes me pronounce it "powers hell" whenever I am forced to deal with it. *shudder*

6

u/PlanetVisitor 17d ago

Desired filesystem lifecycle state:  Absent.

Man 🤣

2

u/[deleted] 12d ago
-WhatIf:$false `

10

u/git_push_origin_prod 17d ago edited 17d ago

🐫? sure. 🐍? why_not. ProperCase!?! YouFuckingFacists!?!

12

u/PlanetVisitor 17d ago

I've never found myself at ease with syntax and casing in PowerShell.

It just feels personal

Every time something seems to make sense, then another thing pops up that completely destroys my mental model of how it works.

I can live with the Unix answers of "Because someone decided to do it like that in 1977, and it just works." Fine. But PowerShell was designed from the ground up to Be-Logical==true;

7

u/git_push_origin_prod 17d ago

I was kidding earlier but ProperCase is for ProjectNames, not executable names or variable names. That’s my belief system lol

2

u/PlanetVisitor 17d ago

yeah it's just... What functionality does it really add?

It just makes me think of a decision that was made because it looked really good and sensible when it was pitched to high management by a guy with a slick tongue that doesn't really know his stuff. And management just refused to change it since then because they are convinced it's a ReallyGood-Thing, even though they can't explain why.

1

u/DiodeInc 17d ago

Can you give some examples of mental model destruction?

1

u/PlanetVisitor 17d ago

No, they were destroyed.

1

u/ArduennSchwartzman 17d ago

And where's my backslash, Microsoft bois?

1

u/ataratai 12d ago

isn't powershell case-insensitive though

1

u/[unknown] 18d ago

[removed] — view removed comment

1

u/meinkr0phtR2 18d ago

Of course it was removed by Reddit.

57

u/adelie42 18d ago

What?? You think they would allow shorthand?

44

u/filkos1 18d ago

TrustedInstallerDo Remove /recursive /force C:\

42

u/kolliasl21 18d ago • Popcorn

Sudo rm /r /f c:

17

u/Excellent_Tubleweed 17d ago

"Cannot remove file, file in use."
Engineer laughs. "Heh Good old Microsoft saved my arse"

Reboots, system was wiped except for the intellisense database and the .thumbnails directories.

5

u/creeper6530 17d ago

And Copilot

1

u/DiodeInc 17d ago

What happened?

26

u/tdic89 18d ago

We don’t even need to joke about it, I love PowerShell but it has some borderline comical expressions sometimes.

16

u/tes_kitty 18d ago

Get-ChildItem comes to mind.

15

u/somelinuxuseridk 17d ago

As well as Invoke-RestMethod

10

u/tes_kitty 17d ago

Is that the same als 'sleep' on a Unix system?

3

u/git_push_origin_prod 17d ago

I miss the days of objective C. stringByAppendingString lol u verbose object, orientated son of a bitch lol. Everyone else like + or maybe . But objective c forcing u into intellisense for descriptive naming.

I’m joking, but I kinda do this still. A long descriptive name is better than x.

1

u/UsedArmadillo9842 17d ago

The difference is that every command makes sense. And you can set any alias you want.

The notation is very simple
Verb-thing, even if you dont know the command you can very easily guess what is happening

5

u/tes_kitty 17d ago

I know what Get-ChildItem does, but there is no way to guess what it does when you have no context. There are no childs in a filesystem.

1

u/UsedArmadillo9842 17d ago

Yes you need a bit of context, but once you figure out that everything is considered an item it makes sense.

Like you can check the registry with Get-Childitem, or Environment Variables with it because it just gets the childitems

1

u/tes_kitty 17d ago

I'm usually on Unix, there are no items, there are only files.

1

u/UsedArmadillo9842 17d ago

Well, everything in windows is an item. A file? An item. A variable? An item.

If you get that concept, then "get-childitem" makes a lot of sense. And as follow up the "get-item" as well.

I do love the powershell

1

u/AdorablSillyDisorder 11d ago

And that's fundamental difference between unix shell and psh - unix operates on files and text, powershell primarily operates on structured objects; files and lines of text are just one type of an object. Harder to learn and internalize, but generally works fine.

1

u/tes_kitty 11d ago

In the end, it's still a file.

To me Powershell feels like they tried to copy a Unix shell but didn't quite get the idea.

8

u/YTriom1 17d ago

SuperUserDo Remove -Recursive -Force \

5

u/Even_Shallot6345 17d ago

Sudo Rm /Rf \

2

u/DeadlyVapour 18d ago

OP doesn't know the difference between bash and the GNU tools.

7

u/ManagementEasy9313 18d ago

This is meme. I got a lot hateful commenta for it. But its just meme.

-5

u/SaltAssault 17d ago

It's a hateful meme, don't act surprised when you set the tone yourself.

6

u/ManagementEasy9313 17d ago

Microsoft memes are normal thing.

9

u/spektre 17d ago

It's a joke about Microsoft, it's supposed to be hateful. That's the rules.

1

u/ManagementEasy9313 18d ago

happy Cake day btw

4

u/PlanetVisitor 18d ago

`rm` is not necessarily a GNU-tool, so...

3

u/ThePythagorasBirb 17d ago

Shouldn't it be SuDo? Since it's an abbreviation of 2 words

4

u/Impossible-Owl7407 17d ago

Super user do Or Substitute user do

SUDo?

2

u/Odd_Philosopher1741 17d ago

Close, but I would've expected something more akin to:

Sudo Rm /Rf \

1

u/letmehaveanameyoudum 18d ago

this is why built in aliases exist

1

u/StrikeAfraid2666 17d ago

Sudo Rm -Rf \

1

u/AtomicThiccBoi 17d ago

op uses arch btw

1

u/RefrigeratorKey277 17d ago

There would be \ instead

1

u/MxAce3157 17d ago

I haven't used Microslop Bindows's terminal in a while, but didn't they use slashes instead of hyphens?

1

u/WildCard65 11d ago

PowerShell uses hyphens

1

u/Ok_Tea_7319 16d ago

Probably more like

SuDo rm /r /f /

1

u/MrFrog2222 13d ago

you mean Run-As-Admin Remove /R /f \

-2

u/Jatinchd 18d ago

more like "rm -rf /*"

1

u/itsoctotv 13d ago

my eyes are bleeding