Support Forum: Get Support for Patch My PC Products and Services

Commercial Products: Support for Our Enterprise Product for Microsoft ConfigMgr and Intune => Commercial/Paid Products: Support and General Questions (ConfigMgr and Intune) => Topic started by: [email protected] on March 12, 2026, 02:53:26 PM

Title: Uninstall-Software.ps1 script and WindowsInstaller option
Post by: [email protected] on March 12, 2026, 02:53:26 PM
Hi - I'm wondering if there's a reason I can only have the uninstall pre-script look for earlier install based only on MSI -OR- EXE. I didn't realize it worked that way until I did a Snagit upgrade coming from mixed install types and am now having to do a bunch of remedial clean up. We should have the option to remove both types of prior install in one go. Thanks!

.PARAMETER WindowsInstaller
    Specify a value between 1 and 0 to use as an additional criteria when trying to find installed software.
    If WindowsInstaller registry value has a data of 1, it generally means software was installed from MSI.
    Omitting the parameter entirely or specify a value of 0 generally means software was installed from EXE
    This is useful to be more specific about software titles you want to uninstall.
Title: Re: Uninstall-Software.ps1 script and WindowsInstaller option
Post by: Andrew Jimenez (Patch My PC) on March 26, 2026, 04:50:29 PM
Hello,

This is good feedback, we'll look into implementing an option to skip that check.
The reason it was designed this way is because our updates are usually targeted based on a specific installer type, so we designed the uninstaller to work in the same way, but having a more "relaxed" option makes sense to me!
Title: Re: Uninstall-Software.ps1 script and WindowsInstaller option
Post by: Michiel (Patch My PC) on April 16, 2026, 07:26:24 AM
@Andrew Jimenez (Patch My PC), I noticed the documentation for the "-WindowsInstaller" parameter now states "Specifies the software type to uninstall. Set it to 1 for .msi-based software, 0 for .exe-based software, or omit to target both types based on other criteria". Does this mean the script was updated, and that the parameter now functions as @[email protected] requested?
Title: Re: Uninstall-Software.ps1 script and WindowsInstaller option
Post by: Adam Cook (Patch My PC) on May 20, 2026, 04:14:35 AM
Quote from: [email protected] on March 12, 2026, 02:53:26 PMHi - I'm wondering if there's a reason I can only have the uninstall pre-script look for earlier install based only on MSI -OR- EXE. I didn't realize it worked that way until I did a Snagit upgrade coming from mixed install types and am now having to do a bunch of remedial clean up. We should have the option to remove both types of prior install in one go. Thanks!

.PARAMETER WindowsInstaller
    Specify a value between 1 and 0 to use as an additional criteria when trying to find installed software.
    If WindowsInstaller registry value has a data of 1, it generally means software was installed from MSI.
    Omitting the parameter entirely or specify a value of 0 generally means software was installed from EXE
    This is useful to be more specific about software titles you want to uninstall.

I wrote the script - I can confirm what you're looking for is available in the current behaviour. You may want to include the -UninstallAll parameter if there's a chance the device might have more than one match based on your "search criteria" (defined via parameters, such as -DisplayName).
Title: Re: Uninstall-Software.ps1 script and WindowsInstaller option
Post by: [email protected] on July 21, 2026, 11:57:59 AM
I'm sorry @Adam Cook (Patch My PC) I need to revive this question and clarify something.

The script at https://content.patchmypc.com/downloads/scripts/Uninstall-Software.ps1 (which is what my Snagit installer points to as a pre-script) appears to be different than the one here: https://github.com/PatchMyPCTeam/Community-Scripts/blob/main/Uninstall/Pre-Uninstall/Uninstall-Software/Uninstall-Software.ps1

It looks like the script on Github would work the way you describe, but the one provided by PMPC in the Snagit app would not? I've attached screen shots of each.

Thanks!

Title: Re: Uninstall-Software.ps1 script and WindowsInstaller option
Post by: Adam Cook (Patch My PC) on July 21, 2026, 12:14:44 PM
Quote from: [email protected] on July 21, 2026, 11:57:59 AMI'm sorry @Adam Cook (Patch My PC) I need to revive this question and clarify something.

The script at https://content.patchmypc.com/downloads/scripts/Uninstall-Software.ps1 (which is what my Snagit installer points to as a pre-script) appears to be different than the one here: https://github.com/PatchMyPCTeam/Community-Scripts/blob/main/Uninstall/Pre-Uninstall/Uninstall-Software/Uninstall-Software.ps1

It looks like the script on Github would work the way you describe, but the one provided by PMPC in the Snagit app would not? I've attached screen shots of each.

Thanks!

I just ran a diff between the two files, and aside from the comment based help and digital signature, these are the only two differences. It is otherwise identical in the main body so they function the same.