Uninstall 5 Programs


  • Is there a way through PowerShell to uninstall 5 programs without having to be present.  I am going to have to do this on at least sixty machines and instead of going through the un-installation process, is there a way to do this by building a simple script and then applying it on all sixty machines?
    Tuesday, June 19, 2012 6:54 PM


  • -match is a regular expression operator, so, depending on how your write it, yes, it could work. Another approach would be to pass it as an array with foreach:

    'app1','app2','app3','app4','app5' | % { 

    $name = $_;

    $app = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -match $name } $app.Uninstall()


    Thursday, June 21, 2012 9:59 PM
  • Hi,

    $app = Get-WmiObject -Class Win32_Product | Where-Object { 
        $_.Name -match "Software Name" 


    Yan Li

    Yan Li

    TechNet Community Support

    Wednesday, June 20, 2012 4:52 AM

All replies