Super User Asked on November 9, 2021
I have a set of programs I would like to uninstall with Powershell.
Get-WmiObject Win32_Product | where-Object {$_.name -Like "MySQL*"}
How do I pipe this to an uninstall function?
Some questions seems to use msiexec
, but others recommend .uninstall()
?
You could take the existing output and call Uninstall()
for each product:
Get-WmiObject Win32_Product | where-Object {$_.name -Like "MySQL*"} | ForEach-Object { $_.Uninstall() }
Just be very sure you want to uninstall every product starting with "MySQL".
It should also be quicker if you do your filtering from the WMI query:
Get-WmiObject Win32_Product -Filter "name LIKE 'MySQL%'" | ForEach-Object { $_.Uninstall() }
Answered by Luke Humberdross on November 9, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP