Found while doing forensics on some rediscovered loose flash drives.

      • skilltheamps@feddit.de
        link
        fedilink
        arrow-up
        16
        arrow-down
        3
        ·
        8 months ago

        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

      • Carighan Maconar@lemmy.world
        link
        fedilink
        arrow-up
        6
        arrow-down
        3
        ·
        8 months ago

        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.

    • OfficerBribe@lemm.ee
      link
      fedilink
      arrow-up
      11
      ·
      edit-2
      8 months ago

      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.

  • KᑌᔕᕼIᗩ@lemmy.ml
    link
    fedilink
    English
    arrow-up
    8
    arrow-down
    1
    ·
    8 months ago

    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.

    • lud@lemm.ee
      link
      fedilink
      arrow-up
      4
      arrow-down
      6
      ·
      8 months ago

      At least it’s more readable than Bash.

      Although that’s not much of an accomplishment.

    • catsup@lemmy.one
      link
      fedilink
      arrow-up
      15
      ·
      8 months ago

      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

    • icanwatermyplants@reddthat.com
      link
      fedilink
      arrow-up
      5
      arrow-down
      14
      ·
      8 months ago

      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.

      • lud@lemm.ee
        link
        fedilink
        arrow-up
        2
        arrow-down
        1
        ·
        edit-2
        8 months ago

        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.