如何使用 PowerShell 获取已安装 Windows 程序的逗号分隔 table?

How to get a comma separated table of installed Windows programs using PowerShell?

我需要获取计算机上已安装程序的列表 (Windows 10),以逗号分隔格式显示程序名称和版本,格式如下:程序名称、版本

我尝试过的:

我目前正在使用这个 Windows PowerShell 命令:

Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion | Format-Table –AutoSize  

这让我 table 看起来像这样:

我希望它看起来像这样(table header 格式不重要):

有没有一种方法可以格式化 table 来完成这个或另一个 PowerShell 命令来产生类似于第二个 table 的输出?

尝试这样的事情:

Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion | ConvertTo-Csv -NoTypeInformation

另见 Export-Csv