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 2 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: 1
      Replies: 342
      Points: 326
      Helping Hand
      Rank: Contributor

      You could map it using the CIM class CIM_LogicalDiskBasedOnPartition

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

      • This reply was modified 1 week, 4 days ago by Matt Bloomfield. Reason: Code formatting
      • This reply was modified 1 week, 4 days ago by Matt Bloomfield. Reason: Moved code to gist due to crappy formatting
      • This reply was modified 1 week, 4 days 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.

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