Search code examples
powershellbatch-filecommand

how to get all installed software in windows machine using 'Get-ItemProperty' from powershell?


I tried this in my script. Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall* | Select-Object DisplayName | Format-Table -AutoSize >>as.txt

Output: 'Get-ItemProperty' is not recognized as an internal or external command, operable program or batch file.


Solution

  • If you have an x64 version of Windows, perhaps something like this single line batch file would help:

    @%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile "$MyProgs = Get-ItemProperty 'HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*'; $MyProgs += Get-ItemProperty 'HKLM:SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*'; $MyProgs.DisplayName | Sort-Object -Unique" 1>"as.txt"