title: Get-WMIObject Uninstall vs Get-CIMInstance Uninstall
body: <p>Probably a dumb question but, I'm just curious.</p>
  <p>Is there a difference between <code>Get-CIMInstance</code> and <code>Get-WMIObject</code> when Invoking an Uninstall for an application under the <code>Win32_Product</code> class? Only reason I ask is because:</p>
  <ul>
  <li>Using <code>Get-CIMInstance</code> to uninstall an application, will reboot my computer with certain programs.</li>
  <li>Using <code>Get-WMIObject</code> to uninstall an application just runs without rebooting.</li>
  </ul>
  <p>Also, piping a <code>Get-Member</code> to any <code>Get-CIMInstance</code> product, doesn't give me a method to uninstall but, it does using <code>Get-WMIObject</code>. Is this just how the developers wrote it? Although, <code>Invoke-CIMMethod -Name Uninstall</code> still works.</p>
  <h2>Get-CIMInstance / Uninstall</h2>
  <p>Heres what I was doing to uninstall multiple apps using <code>Get-CIMInstance</code>/<code>Invoke-CIMMethod -Name Uninstall</code>:</p>
  <pre><code>Get-CimInstance -ClassName win32_product | Where-Object Name -Match &quot;Visual&quot; | 
      ForEach-Object -Process { 
          Invoke-CimMethod -InputObject $_ -Name Uninstall 
                              }
  #Methods Returned
  &lt;#
  Get-CimInstance -ClassName win32_product | Where-Object Name -Match &quot;Visual&quot; | Get-Member -MemberType Method
  
  
     TypeName: Microsoft.Management.Infrastructure.CimInstance#root/cimv2/Win32_Product
  
  Name                      MemberType Definition
  ----                      ---------- ----------
  Clone                     Method     System.Object ICloneable.Clone()
  Dispose                   Method     void Dispose(), void IDisposable.Dispose()
  Equals                    Method     bool Equals(System.Object obj)
  GetCimSessionComputerName Method     string GetCimSessionComputerName()
  GetCimSessionInstanceId   Method     guid GetCimSessionInstanceId()
  GetHashCode               Method     int GetHashCode()
  GetObjectData             Method     void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Ser...
  GetType                   Method     type GetType()
  ToString                  Method     string ToString()
  #&gt;
  </code></pre>
  <h2>Get-WMIObject / Uninstall</h2>
  <pre><code>Get-WMIObject -ClassName win32_product | Where-Object Name -Match &quot;Visual&quot; | 
      ForEach-Object -Process { 
          Invoke-WMIMethod -InputObject $_ -Name Uninstall 
                              }
  #Methods Returned
  &lt;#
  Get-WMIObject -Class win32_product | Where-Object Name -Match &quot;Visual&quot; | Get-Member -MemberType Method
  
  
     TypeName: System.Management.ManagementObject#root\cimv2\Win32_Product
  
  Name      MemberType Definition
  ----      ---------- ----------
  Configure Method     System.Management.ManagementBaseObject Configure(System.UInt16 InstallState, System.UInt16 InstallLevel, S...
  Reinstall Method     System.Management.ManagementBaseObject Reinstall(System.UInt16 ReinstallMode)
  Uninstall Method     System.Management.ManagementBaseObject Uninstall()
  Upgrade   Method     System.Management.ManagementBaseObject Upgrade(System.String PackageLocation, System.String Options)
  #&gt;
  </code></pre>
  <p>Pardon the long post, just a curious mind.</p>
  <p>Please delete/close if not allowed.</p>