Powershell COM objects

I was trying to create a COM object in powershell like this

$obj= New-Object -ComObject MyProject.MyClass
$obj|Get-Member

When I ran it I received this error:
New-Object : Retrieving the COM class factory for component with CLSID {E51BB9FD-F8EF-4636-8DE3-1ADE61B670AD} failed due to the following error: 80040154 Class not registered (Exception 
from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))

I just used regsvr32 on the dll so I knew it was registered and I verified it with regedit

Figured out I was running the 64bit version of powershell.  It worked using the 32bit version.

I also noticed that if the COM object is not registered the error is 
New-Object : Retrieving the COM class factory for component with CLSID {00000000-0000-0000-0000-000000000000} failed due to the following error: 80040154 Class not registered (Exception 
from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

Print | posted on Wednesday, August 14, 2013 10:58 AM