【发布时间】:2016-05-10 19:25:15
【问题描述】:
我正在尝试运行这个 powershell 命令:
Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize > C:\Users\Administrateur\Desktop\Mysoftware.txt
在批处理文件中。这就是我现在得到的:
powershell.exe -noexit -command "& {Get-ItemProperty 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*'; Select-Object DisplayName, DisplayVersion, Publisher, InstallDate; Format-Table -Autosize; > 'C:\Users\Administrateur\Desktop\Mysoftware.txt';}"
但它告诉我 ">" 不是命令
我要做的是在 MySoftware.txt 文件中获取计算机所有软件的列表。
感谢您的帮助
【问题讨论】:
-
反引号?写输出?顺便说一句,为什么批处理而不是豪华脚本?
-
您添加了 ;在您显示的豪华命令中没有的 > 之前。
-
另外,这只会显示已安装的 32 位应用程序。
标签: powershell batch-file command-line