Application details via script

windowstomac554

macrumors newbie
Original poster
Jul 12, 2019
2
0
Hi All,
Sorry if this has been covered before however I could not find an appropriate thread within the forum pages.
I currently am trying to automate the following process but have come unstuck coming from a windows background.
Essentially, from Terminal I need to collect the applications (incl version number) that are installed on a workstation, extract that data into a text file and eventually export it into a MS excel s/s.
I have run cmd pkgutil --pkgs which isnt tidy or a complete list, but am unsure how to 'push' this data automatically into a txt file once the list of applications is completed running.
In windows I was able to retrieve this info mainly from the reg - no luck so far in the Mac world for something similar.
Any guidance would be great.

Thanks

Running on MacOS 10.14
 

windowstomac554

macrumors newbie
Original poster
Jul 12, 2019
2
0
You can do something like:
Code:
/usr/sbin/system_profiler SPApplicationsDataType > ~/Desktop/Apps.txt
Thanks mate, that works a treat. Now the txt file is compiled, I will be able to "get-content / Export-Excel" this file in to Excel?
 

Red Menace

macrumors 6502
May 29, 2011
380
45
Littleton, Colorado, USA
The text can be massaged into whatever format you want, but you haven’t mentioned what you are using (shell script? AppleScript?) or how you are planning on importing the info into Excel (CSV file?).