(Get-WmiObject -Class Win32_Product -Filter "Name LIKE '%Barracuda%Outlook Add-In%'").Uninstall() RRS feed

  • Question

  • Method invocation failed because [system.Object[]] doesnt contain a method named 'Uninstall'.

    • Moved by Bill_Stewart Wednesday, September 13, 2017 9:19 PM Unanswerable drive-by question
    Thursday, July 27, 2017 8:19 PM

All replies

  • A collection or an array does not expose methods of the contained object.  You must enumerate the objects in the array and handle them one at a time.

    Yes. I know.  The notation enumerates for "properties" of objects in a collection.  It does not enumerate for methods.

    Use ForEach-Object to enumerate the array.


    Thursday, July 27, 2017 8:25 PM