get-wmiobject -class Win32_SCSIControllerDevice を使用して、Antecedent および Dependent デバイスの 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
これらの 2 つのコマンドをネストして、以下の例のような結果を得るにはどうすればよいですか?
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
さまざまなフォーマットを試してみましたが、サインラインにはありません。