aaronparker / packagefactory

A packaging factory for Microsoft Intune using Evergreen, VcRedist, and IntuneWin32App
https://stealthpuppy.com/packagefactory/
MIT License
63 stars 18 forks source link

Bugfix for Uninstall-Msi in Windows PowerShell 5.1 #48

Closed lwalthert closed 9 months ago

lwalthert commented 9 months ago

This fixes two bugs:

In Windows PowerShell the Start-Process Cmdlet doesn't support the -WhatIf parameter. Start-Process is being passed a WhatIf parameter in the function Uninstall-Msi and couldn't be executed. To fix this I removed the -WhatIf parameter from the parameter list and wrapped the code that calls the uninstaller in an if statement that calls '$PSCmdlet.ShouldProcess()'.