none
Trying to uninstall a program that shows in Programs and Features. RRS feed

  • Question

  • I am trying to uninstall a program that shows in Programs and Features but is not found when I use the following:

    $app=Get-WmiObject–ClassWin32_Product|Where-Object{$_.Name -eq"Program name"}     

    $app.Uninstall()

    When I run: 

    Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Unintall\* | Select-Object Displayname, displayversion, publisher, installdate | format-table -Autosize

    I can see the application in the list however there is no Publicher or Installdate, yet it is installed as confirmed by the Programs and Features window.

    I am searching the Internet to see if someone has asked this questions.  I found one but does not identify how to.  Any help will be greatly appreciated.

    • Moved by Bill_Stewart Monday, July 29, 2019 7:22 PM Abandoned
    Thursday, July 26, 2018 5:06 PM

All replies

  • You have to get the exact program name:

    Get-WmiObject Win32_Product -Filter "Name LIKE '%Program name%'"

    Look for the name you are trying to use and use that exact string.

    Please refrain from posting colorized code. It is hard to read and cannot be copied without errors.

    Use the code posting tool provided.


    \_(ツ)_/

    Thursday, July 26, 2018 5:26 PM
  •     
    get-content computernames.txt |
        ForEach-Object{
            Get-CimInstance -ClassName Win32_Product  -Filter "Name like '%*virtualbox%'" -ComputerName $_ |
                ForEach-Object{
                    Invoke-CimMethod -Query "select * from Win32_Product where Name='$($_.Name)'" -MethodName Uninstall
                }
        }


    \_(ツ)_/

    Thursday, July 26, 2018 5:27 PM