UninstallString & Split I need help

Hi i am new to powershell and my skill extends to some one liners but most of the time i copy a script test and then use and amend it.

i have been trying to uninstall the software below which i have been able to with two pieces of script the last remaining software is dell optimizer which i finding difficulty to find any any script for this
these are the package names
Get-Package “Dell Optimizer
Get-Package -name “Dell Optimizer
Get-Package -name “Dell Command
Get-Package -name “Dell SupportAssist Remediation
Get-Package -name “SupportAssist
Get-Package -name “Dell Power Manager Service
Get-Package -name “Dell Digital Delivery Services
Get-Package -name “Dell OptimizerUI
Get-Package -name “SupportAssist OS Recovery Plugin for Dell Update

I used this get-package to uninstall: Dell command Dell power mananager Dell digital Services

Get-Package -Name “packagenamehere” | Uninstall-Package this worked for some fo the dell software

I have had to use this command to uninstall the dell Support assist as the get package uninstall did not work.

$SAVer = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall |

Get-ItemProperty |

    Where-Object {$_.DisplayName -match "SupportAssist" } |

    Where-Object {$_.DisplayVersion -notlike "3.2*"} |

        Select-Object -Property DisplayVersion, UninstallString, PSChildName

ForEach ($ver in $SAVer) {

If ($ver.UninstallString) {



    $uninst = $ver.UninstallString

    & cmd /c $uninst /quiet /norestart



}

}

I am now on the software called Dell optimizer I tried to change the name in the script above but that removes the dell support assist but it doesn’t work.

found the UninstallString and name by trying to remove using the HKLM:

$unins = Get-ChildItem “HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall” -ErrorAction SilentlyContinue | Get-ItemProperty | Where-Object {$_.DisplayName -Like “Dell Optimzer”} | Select Displayname, Uninstallstring
and then using this $unins which displays the uninstall string

DisplayName UninstallString


Dell Optimizer Service “C:\Program Files (x86)\InstallShield Installation Information{286A9ADE-A581-43E8-AA85-6F5D58C7DC88}\DellOptimizer.exe” -remove -runfromtemp

Next i ran Start-Process -FilePath $Unins.Uninstallstring -ArgumentList “/S” -wait which doenst work i think its something to do with the uninstallstring but not sure how to amend or fix it.

any help would be great i was advise to split this but in didnt know wha that means at my stage in powershell i feel a little stupid but honest enough to ask for help

some suggestions as i do not have this application available locally to review myself

  1. have you checked DELL information and check the software requires it to be uninstalled in a specific order
  2. have you also reviewed the uninstall provided in the 64bit path
  3. is there any error information you can capture to provide extra information
  4. does the uninstall process generate any log files that could be reviewed

otherwise i do not have much more i can offer - you obviously have the code ability to perform the results

PSCode,

thank you for your guidance, as you know i new to power shell script so in answer to your questions

1 I wouldn’t know where to check if the software needs to be uninstall in a specific order, however i will try and find out.

2 Review the uninstall path i followed a video which said $unins = Get-ChildItem “HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall” -ErrorAction SilentlyContinue | Get-ItemProperty | Where-Object {$_.DisplayName -Like “Dell Optimzer ”} | Select Displayname, Uninstallstring

after running the this script the video said to check the path to the uninstall you then type $unins
after entering this command the screen produces the path which is the uninstall string (now the video was uninstalling something different ) but i found the uninstall string from the registry and i confirmed the path to the uninstall string by entering the following

$unins after entering this the line below appeared
what also learn is that if i copied the line below into a run command the Gui uinstaller appears so i believe this is the uinstall path.

Dell Optimizer Service “C:\Program Files (x86)\InstallShield Installation Information{286A9ADE-A581-43E8-AA85-6F5D58C7DC88}\DellOptimizer.exe” -remove -runfromtemp

3 There is an error and i will make a note of the error

4 i will find out if there are any error logs generated.

Thank for you questions.