Here’s a simple way to debug and quickly prototype COM objects with Visual Studio and PowerShell. In the Debug section of the project properties for the COM object, just put in the PowerShell executable. For command line arguments you can then specify the New-Object cmdlet to instantiate the COM object. This is the command line I’m using.
-noexit -Command "$Client = New-Object -ComObject MyProgId"
Here are my project properties.
Notice that I have Attach set to No. This was misleading at first, but it sets whether to attach to an already running process. We want to launch a new process. It works successfully with a VC6 COM DLL in my experimentation. I was able to set breakpoints and step through my code with ease. You have to make sure to register your DLL during the build so that the New-Object finds the correct version.