first post here. I am trying to make a script that will only format mechanical hard drives on a computer and leaves the SSD(s) as they are. Can someone explain why the following occurs:
PS C:\Users\hekke> Get-PhysicalDisk | Where-Object -Property mediatype -EQ hdd
gives me the output:
Number FriendlyName SerialNumber MediaType CanPool OperationalStatus HealthStatus Usage Size
------ ------------ ------------ --------- ------- ----------------- ------------ ----- ----
0 WDC WD10TPVT-00U4RT1 WD-WXH1A81P7778 HDD False OK Healthy Auto-Select 931.51 GB
1 WDC WD5000LPVX-22V0TT0 WD-WX71AA4H4EV2 HDD False OK Healthy Auto-Select 465.76 GB
But when I do:
PS C:\Users\hekke> Get-PhysicalDisk | Where-Object -Property mediatype -EQ hdd | Select-Object number
it only gives me the empty number table:
number
------
I am new to powershell, thanks in advance to anyone willing to help