叫我愚蠢,但我正在用这个丢我的头发.
我有两个Get-WmiObject的结果:
$cpu = Get-WmiObject -Class Win32_Processor $mb = Get-WmiObject -Class Win32_BaseBoard
$cpu | Select-Object Name,Description | ConvertTo-Csv -NoTypeInformation
和
$mb | Select-Object Manufacturer,Product | ConvertTo-Csv -NoTypeInformation
但是,我可以加入这两个输出,并从两个CSV文件中输出一个CSV输出?就像是:
( ($cpu | Select-Object Name,Description) + ($mb | Select-Object Manufacturer,Product) ) | ConvertTo-Csv -NoTypeInformation
(当然这个语法是无效的,只是为了显示点)