0

I'm new to this site. I am trying to create a powershell script where the msiexec would uninstall an application using the identifying number.

$Adobe = gwmi Win32_product -filter {name like "%Adobe%"}
foreach ($app in $Adobe) {"msiexec.exe /x /qn 
 $($App.IdentifyingNumber)"}

The script would gather the identifying numbers but the msiexec would not run the uninstaller. Any advice would be appreciated.

  • Remove the double quotes enclosing the command you want to execute not just display. – LotPings Oct 16 '18 at 21:43
  • @LotPings I didn't try that, but moving the switches /qn at the end of the line fixed the problem. foreach ($app in $Adobe) {"msiexec.exe /x $($App.IdentifyingNumber)" /qn} – Andy X Oct 18 '18 at 17:19

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.