Powershell: Verify if a application is installed (the right way)!

There are a few different ways to skin this problem… An initial search will point you in the direction of using WMI Win32_Product class. Avoid this at all costs for reasons mentioned here.

Use this approach instead:

gci "HKLM:\software\Wow6432Node\Microsoft\windows\CurrentVersion\Uninstall" | %{ gp $_.PSPath } | where {$_.DisplayName -match "{Application Name}"}

Enjoy!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: