CPMR0059 - Don't Use Get-WmiObject For Finding Installed Packages (script)

CPMR0059 - Don't Use Get-WmiObject For Finding Installed Packages (script)

:choco-warning: WARNING

This rule has been marked as a Suggestion.

Suggestions are either newly introduced items that will later become Guidelines or items that are don't carry enough weight to become a Guideline. Either way they should be considered. A package version can be approved without addressing Suggestion comments.

Issue

In an automation script (.ps1/.psm1), you used Win32_Product. This can cause serious performance issues and have an adverse affect on Windows.

Instead do a registry search under Uninstaller to see if the application is installed.

Reasoning

"Win32_Product" forces Windows Installer to reconfigure every application installed through MSI (see Windows event log). Depending on installed applications it may take more than 30 minutes to execute a request.