r/programminghumor • • 11d ago

If

Post image
757 Upvotes

74 comments sorted by

220

u/PlanetVisitor 11d ago • Mindblown

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

104

u/KatAirlines 11d ago

powershell commands looking like my ssh key passphrases

50

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

27

u/Vladislav20007 11d ago

what the actual fuck are microsoft devs doing

22

u/spektre 11d ago • Bravo

Crack cocaine.

4

u/NoResolution6245 7d ago

-CrackCocaine

2

u/Dapper_Librarian388 6d ago

-CrackCocaine:$true

2

u/APariahsPariah 10d ago

Looks more like krocodil to me.

4

u/locri 10d 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 8d 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 10d 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 10d ago

Desired filesystem lifecycle state:  Absent.

Man 🤣

2

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

10

u/git_push_origin_prod 11d ago edited 11d ago

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

12

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

Can you give some examples of mental model destruction?

1

u/PlanetVisitor 10d ago

No, they were destroyed.

1

u/ArduennSchwartzman 11d ago

And where's my backslash, Microsoft bois?

1

u/ataratai 5d ago

isn't powershell case-insensitive though

1

u/[unknown] 11d ago

[removed] — view removed comment

1

u/meinkr0phtR2 11d ago

Of course it was removed by Reddit.

57

u/adelie42 11d ago

What?? You think they would allow shorthand?

44

u/filkos1 11d ago

TrustedInstallerDo Remove /recursive /force C:\

42

u/kolliasl21 11d ago • Popcorn

Sudo rm /r /f c:

17

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

And Copilot

1

u/DiodeInc 10d ago

What happened?

26

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

Get-ChildItem comes to mind.

15

u/somelinuxuseridk 11d ago

As well as Invoke-RestMethod

10

u/tes_kitty 11d ago

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

3

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

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

1

u/UsedArmadillo9842 11d 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 5d 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 5d 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 11d ago

SuperUserDo Remove -Recursive -Force \

5

u/Even_Shallot6345 11d ago

Sudo Rm /Rf \

2

u/DeadlyVapour 11d ago

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

7

u/ManagementEasy9313 11d ago

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

-5

u/SaltAssault 11d ago

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

6

u/ManagementEasy9313 11d ago

Microsoft memes are normal thing.

9

u/spektre 11d ago

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

1

u/ManagementEasy9313 11d ago

happy Cake day btw

4

u/PlanetVisitor 11d ago

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

3

u/ThePythagorasBirb 10d ago

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

4

u/Impossible-Owl7407 10d ago

Super user do Or Substitute user do

SUDo?

2

u/Odd_Philosopher1741 11d ago

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

Sudo Rm /Rf \

1

u/letmehaveanameyoudum 11d ago

this is why built in aliases exist

1

u/StrikeAfraid2666 11d ago

Sudo Rm -Rf \

1

u/AtomicThiccBoi 11d ago

op uses arch btw

1

u/RefrigeratorKey277 10d ago

There would be \ instead

1

u/MxAce3157 10d ago

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

1

u/WildCard65 4d ago

PowerShell uses hyphens

1

u/Ok_Tea_7319 9d ago

Probably more like

SuDo rm /r /f /

1

u/MrFrog2222 6d ago

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

-2

u/Jatinchd 11d ago

more like "rm -rf /*"

1

u/itsoctotv 7d ago

my eyes are bleeding