Sujo, mas eu fui com o WMI para obter as unidades e, em seguida, fazer o loop com base em extensões exclusivas:
$computer = Get-ADcomputer ComputerName
$drives = Get-WmiObject win32_volume -ComputerName $computer.DNSHostName | Where-Object {$_.DriveType -eq 3 -and $_.DriveLetter -ne $null -and $_.Label -ne "System Reserved"}
Foreach ($drive in $drives)
{
$allfiles = gci $drive.DriveLetter -recurse | Select Name,FullName,Extension,Length,LastWriteTime
$extensions = $allfiles | Select -Unique Extension
Foreach ($ext in $extensions)
{
$filename = ($drive | Select -ExpandProperty DriveLetter -First 1)[0] + ($ext | Select -ExpandProperty Extension -First 1)
$extensionfiles = $allfiles | Where-Object {$_.Extension -eq $ext.extension}
#$extensionfiles.count
$extensionfiles | Export-Csv C:\Temp\$filename.csv -Notypeinformation
}
}
A chamada WMI trará apenas unidades locais.