r/programminghumor • • 23d ago

If

Post image
759 Upvotes

74 comments sorted by

221

u/PlanetVisitor 23d ago • Mindblown

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

105

u/KatAirlines 23d ago

powershell commands looking like my ssh key passphrases

52

u/spektre 22d 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 22d ago

what the actual fuck are microsoft devs doing

23

u/spektre 22d ago • Bravo

Crack cocaine.

5

u/NoResolution6245 19d ago

-CrackCocaine

3

u/Dapper_Librarian388 18d ago

-CrackCocaine:$true

2

u/APariahsPariah 22d ago

Looks more like krocodil to me.

4

u/locri 22d 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 19d 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 22d 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 22d ago

Desired filesystem lifecycle state:  Absent.

Man 🤣

2

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

10

u/git_push_origin_prod 22d ago edited 22d ago

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

12

u/PlanetVisitor 22d 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 22d 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 22d 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 22d ago

Can you give some examples of mental model destruction?

1

u/PlanetVisitor 22d ago

No, they were destroyed.

1

u/ArduennSchwartzman 22d ago

And where's my backslash, Microsoft bois?

1

u/ataratai 17d ago

isn't powershell case-insensitive though

1

u/[unknown] 23d ago

[removed] — view removed comment

1

u/meinkr0phtR2 22d ago

Of course it was removed by Reddit.

57

u/adelie42 23d ago

What?? You think they would allow shorthand?

44

u/filkos1 23d ago

TrustedInstallerDo Remove /recursive /force C:\

42

u/kolliasl21 23d ago • Popcorn

Sudo rm /r /f c:

17

u/Excellent_Tubleweed 22d 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 22d ago

And Copilot

1

u/DiodeInc 22d ago

What happened?

26

u/tdic89 23d 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 22d ago

Get-ChildItem comes to mind.

15

u/somelinuxuseridk 22d ago

As well as Invoke-RestMethod

10

u/tes_kitty 22d ago

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

3

u/git_push_origin_prod 22d 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 22d 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 22d 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 22d 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 22d ago

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

1

u/UsedArmadillo9842 22d 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 16d 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 16d 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 22d ago

SuperUserDo Remove -Recursive -Force \

5

u/Even_Shallot6345 22d ago

Sudo Rm /Rf \

2

u/DeadlyVapour 23d ago

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

7

u/ManagementEasy9313 23d ago

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

-5

u/SaltAssault 22d ago

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

6

u/ManagementEasy9313 22d ago

Microsoft memes are normal thing.

9

u/spektre 22d ago

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

1

u/ManagementEasy9313 23d ago

happy Cake day btw

4

u/PlanetVisitor 23d ago

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

3

u/ThePythagorasBirb 22d ago

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

4

u/Impossible-Owl7407 22d ago

Super user do Or Substitute user do

SUDo?

2

u/Odd_Philosopher1741 22d ago

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

Sudo Rm /Rf \

1

u/letmehaveanameyoudum 23d ago

this is why built in aliases exist

1

u/StrikeAfraid2666 22d ago

Sudo Rm -Rf \

1

u/AtomicThiccBoi 22d ago

op uses arch btw

1

u/RefrigeratorKey277 22d ago

There would be \ instead

1

u/MxAce3157 22d ago

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

1

u/WildCard65 16d ago

PowerShell uses hyphens

1

u/Ok_Tea_7319 21d ago

Probably more like

SuDo rm /r /f /

1

u/MrFrog2222 17d ago

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

-2

u/Jatinchd 23d ago

more like "rm -rf /*"

1

u/itsoctotv 18d ago

my eyes are bleeding