Page 1 of 1

cannot instantiate PowerShell object

Posted: Tue Jan 26, 2016 6:13 am
by FrankAndrew
Product, version and build: PowerShell Studio 2015, 4.2.99
32 or 64 bit version of product: 64bit
Operating system: Windows 7 Enterprise Service Pack 1 [6.1.7601]
32 or 64 bit OS: 64 bit

To whom it may concern,

I am having the same problem as others have had that PowerShell Studio 2015 cannot see the installed versions of powershell that are present.

The big problem that I am having is that I have a PS1 script that runs fine in PowerShell Studio 2015 using what appears to be powershell v2 but when I run the same exact script in the powershell.exe where up to v4 is available it gives me different results. That makes debugging all the more difficult.

I have read two of the threads in this Forum about this problem.

I have tried the five steps mentioned in the "last update broke my PS" thread to no avail.

Attached is a ZIP file with various screenshots of what my "normal" user can see and what a Local Admin user sees on the exact same machine.

Any help here would be appreciated greatly so that I know what needs to be done when PowerShell Studio 2015 can't see what it should be able to see.

Re: cannot instantiate PowerShell object

Posted: Tue Jan 26, 2016 7:31 am
by Alexander Riedel
If the v3/V4 component is not registered properly, you will get this error message.
There are too many screenshots there for me to understand what you are trying to show. PrimalScript and PowerShell Studio share the PowerShell components and the debugger, so you will always see the same results in both products. So there is no need to post PrimalScript screenshots for a PowerShell Studio problem or vice versa.

There are a few reasons the v3/v4 component is not registered. Usually you have missing .NET runtimes
or a botched installation. Windows installer is not always perfect, so that can happen.

Reboot the machine, reinstall PowerShell Studio. If the problem persists, register the
components manually from the command line (with elevation)

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>RegAsm.exe "C:\program files (x86)\common files\sapien debugger 2015\pwshhelpctrl2015v3.dll" /codebase

and

C:\Windows\Microsoft.NET\Framework\v4.0.30319>RegAsm.exe "C:\program files (x86)\common files\sapien debugger 2015\pwshhelpctrl2015v3.dll" /codebase

Ignore any warnings, please report any errors.

Re: cannot instantiate PowerShell object

Posted: Sun Feb 07, 2016 11:32 pm
by FrankAndrew
Hi Alex,

It was the requirement that the RegisterControls.exe MUST be run after an Update/Installation/RE-Installation that was the cause of my problem.

I did not know that this is an absolute MUST.

If I had NOT let that (RegisterControls.exe) run the first time the program (PowerShell Studio in this case) was started after an update/install/re-install procedure then I would definitely have this problem.

Thanks for the details.

Gruß.