Get-PhysicalDisk -ObjectID

This topic contains 1 reply, has 2 voices, and was last updated by  Curtis Smith 5 months, 3 weeks ago.

  • Author
    Posts
  • #71743

    Brandon
    Participant

    Hi everyone,
    I am a PowerShell novice so I'll get right too it.

    Why does the command below not work?

    Get-PhysicalDisk -ObjectId {1}\\COMPUTERNAME\root/Microsoft/Windows/Storage/Providers_v2\SPACES_PhysicalDisk.ObjectId="{2ab8a2cc-2146-11e7-8363-806e6f6e6963}:PD:{058a823b-0c1e-38ae-7321-c3edf5ed1a2b}"
    

    If I put it in double or single quotes it does not work.

    Thank you for your time!

  • #71759

    Curtis Smith
    Participant

    It's because -ObjectId is expecting a string or an array of strings as input, and you are not supplying a string value.

    Try

    Get-PhysicalDisk -ObjectId '{1}\\COMPUTERNAME\root/Microsoft/Windows/Storage/Providers_v2\SPACES_PhysicalDisk.ObjectId="{2ab8a2cc-2146-11e7-8363-806e6f6e6963}:PD:{058a823b-0c1e-38ae-7321-c3edf5ed1a2b}"'
    

You must be logged in to reply to this topic.