$allSoftwareObj = Get-WmiObject -Class Win32_Product | Select-Object -Property Name, Version | ft -HideTableHeaders | ft -Wrap -AutoSize -Property Name, Version
$allSoftware = Out-String -InputObject $allSoftwareObj
echo $allSoftware
当我输出这个,我得到一个表结构。我不想那样。 如何在每个新输出中只有名称和版本之间留有空格的新行?Powershell:平板电脑输出到一行空间的字符串
现在输出错误:
Microsoft SQL Server System CLR Types 10.51.2500.0
SQL Server 2012 Client Tools 11.1.3000.0
通缉输出:
Microsoft SQL Server System CLR Types 10.51.2500.0
或者:
Microsoft SQL Server System CLR Types (10.51.2500.0)
你使用'格式Table'得到一个表格输出... – JNK
可能是值得一读:http://myitforum.com/ cs2/blogs/gramsey/archive/2011/01/25/win32-product-is-evil.aspx –