Get-PhysicalDisk -ObjectID

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Curtis Smith Curtis Smith 3 weeks, 6 days ago.

  • Author
  • #71743
    Profile photo of Brandon

    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
    Profile photo of Curtis Smith
    Curtis Smith

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


    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.