简体   繁体   中英

Powershell: Export List of apps

I wanted a hands off approach to get a list of all the applications installed on a system. A search brought me to many websites that utilized Get-ItemProperty like on this page here

I quickly found that I could export the list to txt file for easy access at a later time.

Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize > C:\Users\username\Documents\InstalledPrograms-PS.txt

*username is a place holder

What I found, however, is that I could run this when pasting it directly into powershell, but when placing this into a script, it would crash or not run at all.

I'm assuming I'm missing something and a straight copy and paste will not work.

Any help would be appreciated.

NOTE: I'm sure someone is bound to recommend WMIC , but this does not seem to list all the apps.

Update: Seems that within my script

Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*

on its own works just fine. It's when the formatting happens that it crashes.


Solution:

For anyone looking to get an easy and quick way to get a list of all applications, including microsoft store ones, here's what I did. I just have them export to a .txt file to keep for later.

Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table > c:\applist.txt

Microsoft Store Apps

Get-AppxPackage | Select Name, PackageFullName |Format-Table -AutoSize > c:\microsoftlist.txt

It worked for me, although emacs said the '-' before AutoSize was a foreign character. \\226 It may be unicode en dash, 8211 decimal: https://www.fileformat.info/info/unicode/char/2013/index.htm A regular dash would be 45.

[int][char]'–'

8211

By the way, there's also get-package to list installed applications.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM