Skip to content

Instantly share code, notes, and snippets.

@rismoney
Created October 26, 2017 18:43
Show Gist options
  • Save rismoney/f5061f49c73a901b0f509a213b06b10a to your computer and use it in GitHub Desktop.
Save rismoney/f5061f49c73a901b0f509a213b06b10a to your computer and use it in GitHub Desktop.
$uninstall = gci "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" | foreach { gp $_.PSPath } | ? { $_ -match "MyAppAsItAppearsinAddRemovePrograms" } | select UninstallString
$uninstall = $uninstall.UninstallString -Replace "msiexec.exe","" -Replace "/I","" -Replace "/X",""
$uninstall = $uninstall.Trim()
start-process "msiexec.exe" -arg "/X $uninstall /qb" -Wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment