r/programminghumor • • 28d ago

If

Post image
762 Upvotes

74 comments sorted by

221

u/PlanetVisitor 28d ago • Mindblown

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

105

u/KatAirlines 28d ago

powershell commands looking like my ssh key passphrases

52

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

what the actual fuck are microsoft devs doing

23

u/spektre 27d ago • Bravo

Crack cocaine.

5

u/NoResolution6245 24d ago

-CrackCocaine

3

u/Dapper_Librarian388 23d ago

-CrackCocaine:$true

2

u/APariahsPariah 27d ago

Looks more like krocodil to me.

4

u/locri 27d 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 24d 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 27d 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 27d ago

Desired filesystem lifecycle state:  Absent.

Man 🤣

2

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

10

u/git_push_origin_prod 27d ago edited 27d ago

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

12

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

Can you give some examples of mental model destruction?

1

u/PlanetVisitor 27d ago

No, they were destroyed.

1

u/ArduennSchwartzman 27d ago

And where's my backslash, Microsoft bois?

1

u/ataratai 22d ago

isn't powershell case-insensitive though

1

u/[unknown] 28d ago

[removed] — view removed comment

1

u/meinkr0phtR2 27d ago

Of course it was removed by Reddit.

57

u/adelie42 28d ago

What?? You think they would allow shorthand?

44

u/filkos1 28d ago

TrustedInstallerDo Remove /recursive /force C:\

42

u/kolliasl21 28d ago • Popcorn

Sudo rm /r /f c:

17

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

And Copilot

1

u/DiodeInc 27d ago

What happened?

26

u/tdic89 28d 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 27d ago

Get-ChildItem comes to mind.

15

u/somelinuxuseridk 27d ago

As well as Invoke-RestMethod

10

u/tes_kitty 27d ago

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

3

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

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

1

u/UsedArmadillo9842 27d 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 21d 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 21d 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 27d ago

SuperUserDo Remove -Recursive -Force \

5

u/Even_Shallot6345 27d ago

Sudo Rm /Rf \

2

u/DeadlyVapour 28d ago

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

7

u/ManagementEasy9313 28d ago

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

-5

u/SaltAssault 27d ago

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

6

u/ManagementEasy9313 27d ago

Microsoft memes are normal thing.

9

u/spektre 27d ago

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

1

u/ManagementEasy9313 28d ago

happy Cake day btw

4

u/PlanetVisitor 28d ago

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

3

u/ThePythagorasBirb 27d ago

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

4

u/Impossible-Owl7407 27d ago

Super user do Or Substitute user do

SUDo?

2

u/Odd_Philosopher1741 27d ago

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

Sudo Rm /Rf \

1

u/letmehaveanameyoudum 28d ago

this is why built in aliases exist

1

u/StrikeAfraid2666 27d ago

Sudo Rm -Rf \

1

u/AtomicThiccBoi 27d ago

op uses arch btw

1

u/RefrigeratorKey277 27d ago

There would be \ instead

1

u/MxAce3157 27d ago

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

1

u/WildCard65 21d ago

PowerShell uses hyphens

1

u/Ok_Tea_7319 26d ago

Probably more like

SuDo rm /r /f /

1

u/MrFrog2222 22d ago

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

1

u/itsoctotv 23d ago

my eyes are bleeding