PowerShell Uninstall Automation

I have authored the PowerShell Uninstall script.  It gives the ability for IT Operations / ConfigMgr Admins to uninstall multiple versions of a particular software with one process.

Does your organization struggle when trying to cleanup software when standardizing on a application version? I.E. Oracle Java, Adobe Flash, RightFax, IBM products, etc…  Not all the versions you have are in ConfigMgr / SCCM or not in the application model?  If the answer is yes, the PowerShell Uninstall script is for you.

The PowerShell Uninstall script takes inputs from a CSV file.  Using the delimiter of “^”, don’t worry I have included a Excel file to build your CSV.

Since by nature when uninstalling legacy software there maybe pre-or post- process you must run. The PowerShell Uninstall script has functions to call a PowerShell script before or after the uninstall logic.

The PowerShell Uninstall script also includes a Boolean to  create the script as an ConfigMgr / SCCM Application.  In which you can attach to other programs for requirements.

To detect the PowerShell Uninstall script, have ConfigMgr / SCCM check existence of “%SystemDrive%\Program Files\Pomeroy\AppName”.  It will be an empty directory.  For the uninstall just use the command “rmdir /Q /S %SystemDrive%\Program Files\Pomeroy\AppName”

PowerShell Uninstall Script Help:

ConfigMgr Setup Configuration | Application :

ConfigMgr Application Source Directory:

PowerShell Uninstall Automation - ConfigMgr Source Directory

ConfigMgr Application | Deployment Type – General :

PowerShell Uninstall Automation - ConfigMgr App General

ConfigMgr Application Deployment Type – Content:

PowerShell Uninstall Automation - ConfigMgr App Content

ConfigMgr Application Deployment Type – Programs

Install:
powershell.exe -executionpolicy bypass -file .\pomeroy.posh.uninstall.ps1 -FilePath .\RightFaxCodes.txt -AppName “POSHRightFaxUninstall” -SCCM True -PreProcess .\RightFaxPreprocess.ps1

Uninstall:
RMDIR /S /Q “%ProgramFiles%\Pomeroy\POSHRightFaxUninstall”

PowerShell Uninstall Automation - ConfigMgr App Programs

ConfigMgr Application Deployment Type – Detection Method

PowerShell Uninstall Automation - ConfigMgr App Detection

PowerShell Uninstall Automation - ConfigMgr App Detection Rule

ConfigMgr Application Deployment Type – User Experience

PowerShell Uninstall Automation - ConfigMgr App User Experience

The sample files have been included in the download.

Download the files here:

4 thoughts on “PowerShell Uninstall Automation

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.