Get-PhysicalDisk -ObjectID

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!

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}"'