Found while doing forensics on some rediscovered loose flash drives.

97 points

lsusb

Look what they need to mimic a fraction of our power.

permalink
report
reply
62 points

I’ve always been particularly revolted by powershell syntax and utilities

permalink
report
parent
reply
14 points

Yes, if it was as object based as it claims, Get-WmiObject would subtract WmiObject from Get. Instead it is like having all the clutchy drawbacks from being object based without reaping any of the potential bemefits.

If you want anything that actually is object based, just use xon.sh - sane and familiar syntax with insane amounts of power just like that

permalink
report
parent
reply
6 points

Or nushell.

permalink
report
parent
reply
2 points

Is this a joke

permalink
report
parent
reply
4 points

It’s from the beginning meant to be fully scripted though. You’re not supposed to be putting in these commands manually, it’s meant to be used in an environment where the 5-50 commands you or your company needs constantly have aliases and script files defined and on PATH.

permalink
report
parent
reply
11 points

I mean, that’s great, I hate scripting in powershell too though lol.

permalink
report
parent
reply
11 points
*

Get-Disk would have sufficed here, no real need to use WMI here. That said, you would still need to filter USB device and select properties you want to retrieve.

And unrelated, but if WMI class needs to be queried, Get-CimInstance is the preferred method instead of Get-WmiObject for quite some time.

permalink
report
parent
reply
6 points

Text Based OS > Object Based OS

Everything that is wrong with PowerShell in my opinion is driven by the Object Oriented nature of Windows as an OS.

Since everything in Linux is text, grep is king.

permalink
report
parent
reply
21 points

Don’t you think immediately getting the property you’re interested in from an object is easier and more readable than first grepping some output to get the line you want and then removing the leading and trailing garbage on that line manually?

I thing PS scripting would be much more fun if the words weren’t so annoyingly long.

permalink
report
parent
reply
6 points

first grepping some output to get the line you want and then removing the leading and trailing garbage on that line manually

That’s not what we do, though. Give me a more concrete example, and I’ll let you know how I would expect to do it in a nix environment. I’d be curious to compare. Since I have zero experience with powershell, I am not really sure what to expect. The couple times I’ve glanced at a powershell script it looked awful, but I could be falling into Paul Graham’s blub paradox there. OK, I don’t think so, but maybe.

permalink
report
parent
reply
16 points

It would be better if they leaned into it. Instead it is object based…. Until it isn’t because then it’s clunky.

permalink
report
parent
reply
7 points

Also lots of command line tools have a flag to output json, and then you can do everything powershell can

permalink
report
parent
reply
6 points

And for those that don’t you have JC

permalink
report
parent
reply
9 points

Microsoft products in this area are weird to me. Like C#, Powershell is great on one hand yet annoying and more difficult to rangle on the other compared to other solutions that are out there.

permalink
report
reply
-2 points

At least it’s more readable than Bash.

Although that’s not much of an accomplishment.

permalink
report
parent
reply
4 points

Please explain for a dummy.

permalink
report
reply
18 points

OP was trying to get the information for a hard disk in their computer, but after running a command it looks like the serial number for that disk is 💙B

permalink
report
parent
reply
-7 points

The humor is in the amount of hoops to jump through to get some basic info out using Powershell. Under Linux one would use a single command or just check what the system exposes in the form of a file.

I have no idea how to do forensics under Windows to be honest. You’d probably have to write something to get to the block layer so it can be dumped and analyzed. Perhaps OP can amuse us how he went about it.

permalink
report
parent
reply
1 point
*

It’s just one command with a bunch of selects, you could probably just run the first part. I can try it myself later.

There are a lot of software that forensics can use, I don’t know how common windows is but considering its usage for everything else in companies and governments, I wouldn’t be surprised if forensics use primarily Windows.

permalink
report
parent
reply

Programmer Humor

!programmerhumor@lemmy.ml

Create post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.

Community stats

  • 6.9K

    Monthly active users

  • 1.4K

    Posts

  • 32K

    Comments