Categories

W2KSG: Installed software

Knowing what software is installed on a machine is an important piece of information.  We can use WMI to find the software installed by Windows Installer.  Other software won't show.

Listing 8.12

Get-WmiObject -Class Win32_product | Select Name, Caption, IdentifyingNumber, InstallLocation, Vendor, Version | Export-Csv software.txt -NoTypeInformation

A simple use of get-wmiobject to retrieve the win32_product class. We select a number of properties. Finally we export to a csv file.  The -NoTypeInformation prevents PowerShell from writing the .NET type information into the first line of the file.  This is one line of PowerShell.  The VBScript equivalent takes 26 lines - most of it to do with formatting and writing the data to the file.

 

Share this post :

 

Technorati Tags: ,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>