I know I'm a little late but have recently been working on a project and have come up with this which may help:
$bustype_table = @{ #bus type table taken from Microsofts webiste
'0' = 'The bus type is unknown.'
'1' = 'SCSI'
'2' = 'ATAPI'
'3' = 'ATA'
'4' = 'IEEE 1394'
'5' = 'SSA'
'6' = 'Fibre Channel'
'7' = 'USB'
'8' = 'RAID'
'9' = 'iSCSI'
'10' = 'Serial Attached SCSI (SAS)'
'11' = 'Serial ATA (SATA)'
'12' = 'Secure Digital (SD)'
'13' = 'Multimedia Card (MMC)'
'14' = 'This value is reserved for system use (Virtual)'
'15' = 'File-Backed Virtual'
'16' = 'Storage spaces'
'17' = 'NVMe'
}
try
{
$windows_version = (Get-WmiObject Win32_OperatingSystem).Version #Gets windows version.
if($windows_version -gt 10.0.00000) #has to be windows 10.0 or higher. wont work on 7 or 8.
{
$bustype = wmic /namespace:\\root\microsoft\windows\storage path msft_disk get BusType #,Model
$bustype_value = $bustype[2].Trim() #trims whitespace from the bustype value.
$drive_connection = $bustype_table[$bustype_value] #calls the table.
Write-Host "The C drive is connected via: $drive_connection `r`n"
}
}
catch
{
$_.Exception.Message #windows version is pre windows 10. Script wont work.
}
Specifically, this is what you want I think:
wmic /namespace:\\root\microsoft\windows\storage path msft_disk get Model,BusType
Although, this may not work as you have stated that your NVMe drives are in raid so it may pick it up as '8' (RAID).
Let me know how it goes.