Just found out that one of our custom packages has multiple versions and the wrong uninstall key
UninstallString. REG_EXPAND_SZ MsiExec.exe /I(xxxxxxx-....}
How can I replace the /I with an /X using this script?
Find CalcSet installed and remove
$CalcSet = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall |
Get-ItemProperty |
Where-Object {$_.DisplayName -Match “CalcSet" } |
Select-Object -Property DisplayName, UninstallString
$CalcSet
ForEach ($ver in $CalcSet) {
If ($ver.UninstallString) {
New-Item -Path c:\Source\CalcSet.txt -ItemType File -force
$uninst = $ver.UninstallString
& cmd /c $uninst /quiet /norestart