title: Why COM object methods are not visible/accessible in powershell?
body: <p>As described <a href="https://docs.microsoft.com/en-us/powershell/scripting/samples/creating-.net-and-com-objects--new-object-?view=powershell-7#creating-a-desktop-shortcut-with-wscriptshell" rel="nofollow noreferrer">here</a>, COM objects can be created using <code>New-Object -ComObject ProgID</code>.</p>
  
  <p>With the same steps we can create COM object with ProgID <code>wscAPI.WSCProductList.1</code>. But we see no methods are available whereas there are few as per docs <a href="https://docs.microsoft.com/en-us/windows/win32/api/iwscapi/nn-iwscapi-iwscproductlist" rel="nofollow noreferrer">here</a>. Why these methods are not shown/accessible in powershell?</p>
  
  <pre><code>PS C:\&gt;$Wsc = New-Object -ComObject wscAPI.WSCProductList.1
  PS C:\&gt;$Wsc | Get-Member
  TypeName: System.__ComObject
  
  Name                      MemberType Definition
  ----                      ---------- ----------
  CreateObjRef              Method     System.Runtime.Remoting.ObjRef CreateObjRef(type requestedType)
  Equals                    Method     bool Equals(System.Object obj)
  GetHashCode               Method     int GetHashCode()
  GetLifetimeService        Method     System.Object GetLifetimeService()
  GetType                   Method     type GetType()
  InitializeLifetimeService Method     System.Object InitializeLifetimeService()
  ToString                  Method     string ToString()
  </code></pre>
  
  <p>PS: There is a sample code to access these methods using C++ <a href="https://github.com/microsoft/Windows-classic-samples/blob/master/Samples/WebSecurityCenter/cpp/WscApiSample.cpp#L63" rel="nofollow noreferrer">here</a>.</p>
  
  <p>OS: Microsoft Windows 10 Enterprise</p>