I am trying make an uninstall app which removes an application X on a regular basis. The starting point to access applications installed in a Windows machine is through retrieving them from a WMI Class called Win32_Product. But when I run the basic command like this, I get the below error.
I have searched technet and SO, but either their workarounds did not work for me or were too technical in detail which did not make sense to me.
Please help.
ps$ Get-WmiObject -class win32_product
IdentifyingNumber : {09959E11-AD5D-408E-96AF-E3346954D6B8}
Name : Shared Add-in Extensibility Update for Microsoft .NET Framework 2.0 (KB908002)
Vendor : Microsoft
Version : 1.0.0
Caption : Shared Add-in Extensibility Update for Microsoft .NET Framework 2.0 (KB908002)
Get-WmiObject : Generic failure
At line:1 char:14
+ Get-WmiObject <<<< -class win32_product
+ CategoryInfo : InvalidOperation: (:) [Get-WmiObject], ManagementException
+ FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand