This command maps physical disk hardware directly to its assigned logical drive letters on a Windows system. It is used to identify which physical drives house specific partitions without opening graphical interfaces.
The command runs Get-Disk
Copy
Search Site
Search Google
to inventory the physical drives on the system. It then uses a calculated property to pass each disk number into Get-Partition
Copy
Search Site
Search Google
, extracting any assigned drive letters. If a physical disk contains multiple partitions, the script combines the letters into a comma-separated list. The output displays as a clean console table showing the disk number, model name, total size, and child logical drives.
[PowerShell - Get Physical Drive and Logical Drive Letters]
CFFCS | CarrzSynEdit: | PS (PowerShell)
Get-Disk | Select-Object Number, FriendlyName, Size, 
    @{Name="DriveLetters"; Expression={(Get-Partition -DiskNumber $_.Number).DriveLetter -join ", "}} | 
    Format-Table -AutoSize

Output will look something like this.
NumberFriendlyName Size DriveLetters
------ ------------ ---- ------------
1 PNY CS900 250GB SSD 250059350016 A
2 SK hynix SC210 mSATA 256GB 256060514304 B, D
0 SPCC Solid State Disk 128035676160 , , C,
3 SPCC Solid State Disk 256060514304 F, G, H, I
5 USB 3.0 4000787030016 , K
6 EPSON Storage 0
7 Generic MassStorageClass 0
8 Generic MassStorageClass 0