$Rank = @{ 'NVMe/SSD' = 1 'SATA/SSD' = 2 'SATA/HDD' = 3 'RAID/SSD' = 4 'RAID/HDD' = 4 } Get-PhysicalDisk | Select-Object DeviceID, FriendlyName, MediaType, BusType, Size | Group-Object { '{0}/{1}' -f $_.BusType, $_.MediaType} | Where-Object { $Rank.Contains($_.Name) } | Sort-Object { $Rank[$_.Name] } | Select-Object -Expand Group | Export-Csv 'Report.csv' -NoType
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)