/build/static/layout/Breadcrumb_cap_w.png

Uninstalling MSI using Powershell HELP

I'm trying to uninstall snagit 10(if it's installed on the machine) using powershell by using the script below but

it prompts a window asking if I want to keep or remove user data during uninstallation. In order to suppress this in msiexec.

I can use msiexec /x snagit10.smi tsc_data_store-1 qn and it works.   how do I do that using powershell using uninstall()

 

$Result = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -match "Snagit 10.0.2" }

if ($result.name -eq “Snagit 10.0.2”){
$result.uninstall()
}
else {
write-host "Snagit 10 is not installed"
}


0 Comments   [ + ] Show comments

Answers (1)

Answer Summary:
$Result = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -match "Snagit" } if($result.name -eq “Snagitâ€){cmd /c "msiexec /uninstall SnagIT.msi TSC_DATA_STORE=1 /qn"} - See more at: http://www.itninja.com/question/uninstalling-msi-using-powershell-help#sthash.wl3wCJTu.dpuf
Posted by: connan23 11 years ago
Senior Yellow Belt
0

I figured it out guys...

$Result = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -match "Snagit" }
if($result.name -eq “Snagit”){cmd /c "msiexec /uninstall SnagIT.msi TSC_DATA_STORE=1 /qn"}

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ