I have this query that scans all the data of logical drives:
Write-Host "Drive information for $env:ComputerName" Get-WmiObject -Class Win32_LogicalDisk | Where-Object {$_.DriveType -ne 5} | Sort-Object -Property Name | Select-Object Name, VolumeName, VolumeSerialNumber,SerialNumber, FileSystem, Description, VolumeDirty, ' @{"Label"="DiskSize(GB)";"Expression"={"{0:N}" -f ($_.Size/1GB) -as [float]}}, ' @{"Label"="FreeSpace(GB)";"Expression"={"{0:N}" -f ($_.FreeSpace/1GB) -as [float]}}, ' @{"Label"="%Free";"Expression"={"{0:N}" -f ($_.FreeSpace/$_.Size*100) -as [float]}} | Format-Table -AutoSize
Conclusion :

However, I need information about physical disks and their partitions / volumes:
So - for physical disks, I have this command:
Get-Disk
Result :

Question:
I want to combine these two teams. I want to see a disk, and under each disk - information about its logical disk:
- Disk No. 1: .... (information)
> Information about logical drives ..... - Disk No. 2: .... (information)
> This is logical disk information ..... - Disk No. 3: .... (information)
> This is logical disk information ..... - etc...
How can I combine these two queries?
source share