我想在单个输出(例如在表中)使用 get-wmiobject -class Win32_SCSIControllerDevice 获取先行和从属设备的 PnpDeviceId。我想我可以做到:
Get-WmiObject -class Win32_SCSIControllerDevice | ForEach-Object { [WMI]$_.Antecedent} | Format-Table PnpDeviceId
和
Get-WmiObject -class Win32_SCSIControllerDevice | ForEach-Object { [WMI]$_.Dependent} | Format-Table PnpDeviceId
如何嵌套这两个命令以获得如下示例的结果?
PnpDeviceId PnpDeviceId
----------- -----------
PnpDeviceIdAntecedentDevice PnpDeviceIdDependentDevice
PnpDeviceIdAntecedentDevice PnpDeviceIdDependentDevice
PnpDeviceIdAntecedentDevice PnpDeviceIdDependentDevice
编辑:
使用
Get-WmiObject -class Win32_SCSIControllerDevice | ForEach-Object { [WMI]$_.Antecedent, [WMI]$_.Dependent } | Format-Table PnpDeviceId
我有:
PnpDeviceId
-----------
PnpDeviceIdAntecedentDevice
PnpDeviceIdDependentDevice
PnpDeviceIdAntecedentDevice
PnpDeviceIdDependentDevice
PnpDeviceIdAntecedentDevice
PnpDeviceIdDependentDevice
我尝试了不同的格式,但没有信号线。