I ran Get-PhysicalDisk inside a virtual machine which has 4 hard disks. The result was:
FriendlyName SerialNumber CanPool OperationalStatus HealthStatus Usage Size
------------ ------------ ------- ----------------- ------------ ----- ----
VMware, VMware Virtual S False OK Healthy Auto-Select 60 GB
VMware, VMware Virtual S False OK Healthy Auto-Select 100 GB
VMware, VMware Virtual S False OK Healthy Auto-Select 200 GB
VMware, VMware Virtual S False OK Healthy Auto-Select 400 GB
There were no SerialNumber's or any other unique ID that I could see in the result above.
Now, I need to run Set-PhysicalDisk. All examples on the web use the unique FriendlyName or something like PhysicalDisk1. First, there are 4 disks with the same FriendlyName's, so I think I cannot use it. Secondly, I thought PhysicalDisk{number} was a special name to point a disk by the index, but it did not seem to work.
What should I pass to Set-PhysicalDisk, if I want to designate, say, the second disk above (size = 100GB)?
PS C:\Users\Administrator> Set-PhysicalDisk -FriendlyName "VMware, VMware Virtual S" -Usage Retired
Set-PhysicalDisk : Not Supported
At line:1 char:1
+ Set-PhysicalDisk -FriendlyName "VMware, VMware Virtual S" -Usage Reti ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (StorageWMI:ROOT/Microsoft/..._StorageCmdlets) [Set-PhysicalDisk], CimException
+ FullyQualifiedErrorId : StorageWMI 1,Set-PhysicalDisk
PS C:\Users\Administrator> Set-PhysicalDisk PhysicalDisk1 -Usage Retired
Set-PhysicalDisk : The requested object could not be found.
At line:1 char:1
+ Set-PhysicalDisk PhysicalDisk1 -Usage Retired
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (PS_StorageCmdlets:ROOT/Microsoft/..._StorageCmdlets) [Set-PhysicalDisk], CimException