Combine Get-disk and Get-volume information to get the disk number

Welcome Forums General PowerShell Q&A Combine Get-disk and Get-volume information to get the disk number

Viewing 4 reply threads
  • Author
    Posts
    • #263489
      Participant
      Topics: 8
      Replies: 22
      Points: 127
      Rank: Participant

      Hello Experts,

      I am trying to collect disk information from our Hyper-V cluster nodes. If I run Get-volume, I get all the information required except the Disk number. If I run Get-disk, it gives me the disk number but not the other important information like in Get-volume.

      I’m having hard time combining these 2 together to get the disk number associated with Get-volume output.

      Would appreciate any help in this matter.

      Thank you in advance.

    • #263525
      Participant
      Topics: 4
      Replies: 431
      Points: 774
      Helping Hand
      Rank: Major Contributor

      You could map it using the CIM class CIM_LogicalDiskBasedOnPartition

      https://gist.github.com/pandiculator/b3b780d8eef3170c5a55625f3e7ae6a9

      • This reply was modified 3 months, 1 week ago by Matt Bloomfield. Reason: Code formatting
      • This reply was modified 3 months, 1 week ago by Matt Bloomfield. Reason: Moved code to gist due to crappy formatting
      • This reply was modified 3 months, 1 week ago by Matt Bloomfield.
    • #263540
      Participant
      Topics: 8
      Replies: 22
      Points: 127
      Rank: Participant

      Hi,

      Thank you for your response.

      Unfortunately it only gives the information which has a drive letter. I want it against the CSVs in Hyper-V clusters. Get-volume gives me all I need but I would like to collect the disk number, which seems pretty difficult 🙁

      Thanks.

    • #276348
      Participant
      Topics: 0
      Replies: 1
      Points: 5
      Rank: Member

      I just need to vote this issue up. I have the same issue tying up SAN Storage LUN’s with friendly names and DISK ID’s. the annoying thing is this is viewable at a glance in server manager, so why can’t it be done in powershell?!

    • #276372
      Participant
      Topics: 5
      Replies: 269
      Points: 1,065
      Helping Hand
      Rank: Community Hero

      The solution Matt offered works.  If you need all the properties of Get-Volume, you can modify it.  Here’s one way:

       

Viewing 4 reply threads
  • You must be logged in to reply to this topic.