Cannot instantiate PowerShell V5 object: 80070002

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
stng16
Posts: 8
Joined: Tue Dec 22, 2015 8:19 am

Re: Cannot instantiate PowerShell V5 object: 80070002

Post by stng16 » Thu Jan 26, 2017 1:38 pm

- Do you have PrimalScript 2017 installed on this machine as well? No
- Do you have this folder located on your machine? C:\Program Files (x86)\Common Files\SAPIEN Debugger 2017 - No

User avatar
DevinL
Site Admin
Posts: 1098
Joined: Mon Aug 17, 2015 2:25 pm

Re: Cannot instantiate PowerShell V5 object: 80070002

Post by DevinL » Thu Jan 26, 2017 1:59 pm

In that case, one more follow up, can you provide the output for $PSVersionTable so I know exactly which version you're running?
DevinL
SAPIEN Technologies, Inc.

User avatar
stng16
Posts: 8
Joined: Tue Dec 22, 2015 8:19 am

Re: Cannot instantiate PowerShell V5 object: 80070002

Post by stng16 » Thu Jan 26, 2017 2:05 pm

psversion.PNG
psversion.PNG (9.34 KiB) Viewed 1405 times

User avatar
DevinL
Site Admin
Posts: 1098
Joined: Mon Aug 17, 2015 2:25 pm

Re: Cannot instantiate PowerShell V5 object: 80070002

Post by DevinL » Thu Jan 26, 2017 3:56 pm

I'm sorry for the delay Stng16, I'm still trying to find a fix for this issue.

Initially, it was thought you should only have to register the proper DLL's, however, it's apparent that isn't working. I've tried unregistering all previous versions of the DLL and manually registering the correct ones with no success as well.

As I get more information regarding this issue I'll post it here.
DevinL
SAPIEN Technologies, Inc.

User avatar
DevinL
Site Admin
Posts: 1098
Joined: Mon Aug 17, 2015 2:25 pm

Re: Cannot instantiate PowerShell V5 object: 80070002

Post by DevinL » Thu Jan 26, 2017 4:45 pm

Hey Stng,

We've managed to find a workaround that is a bit of work but should get you up and running until we can find a more solid solution. To get this working, try the following steps:
  1. Install PowerShell Studio 2017
  2. Copy the C:\Program Files (x86)\Common Files\SAPIEN Debugger 2017\ folder to your desktop
  3. Uninstall PowerShell Studio 2017 and install PowerShell Studio 2016
  4. Copy the SAPIEN Debugger 2017 folder back to where it was initially located and make sure to replace any files if prompted (step 2)
  5. Launch PowerShell Studio 2016 and run a script
If you have any trouble when taking these steps, please let me know.
DevinL
SAPIEN Technologies, Inc.

User avatar
stng16
Posts: 8
Joined: Tue Dec 22, 2015 8:19 am

Re: Cannot instantiate PowerShell V5 object: 80070002

Post by stng16 » Fri Jan 27, 2017 10:21 am

The workaround works.

Thanks

User avatar
DevinL
Site Admin
Posts: 1098
Joined: Mon Aug 17, 2015 2:25 pm

Re: Cannot instantiate PowerShell V5 object: 80070002

Post by DevinL » Fri Jan 27, 2017 10:22 am

Glad to hear it.

As soon as we get a more solid fix together I'll update this post and let you know.
DevinL
SAPIEN Technologies, Inc.

User avatar
DevinL
Site Admin
Posts: 1098
Joined: Mon Aug 17, 2015 2:25 pm

Re: Cannot instantiate PowerShell V5 object: 80070002

Post by DevinL » Fri Jan 27, 2017 11:10 am

We've managed to find a stable fix that has worked on a few machines I've tested here at the office.

It involves modifying your registry so before continuing, please make sure to backup your system or the registry specifically in case something goes wrong.

After that, we need to delete a few keys from the Registry that reference the SAPIEN Debugger 2017 folder. I launched regedit from the Run dialog (Win + R) and then did a Ctrl + F for SAPIEN Debugger 2017.

Each entry came up in a path like so: HKEY_CLASSES_ROOT\CLSID\{00DFED1F-5A55-4B77-8A05-D128D42EAC6E}\InprocServer32\4.9.73.0

The key that needs to be deleted is the {00DFED1F-5A55-4B77-8A05-D128D42EAC6E}. All of the entries we need to remove reside in HKEY_CLASSES_ROOT so that makes it easier to verify that you're deleting the right keys if you're worried.

Here's a list of the registry entries I had to delete on one of my machines in order to fix this (NOTE: The value within the {} might be different on your machine):
  • HKEY_CLASSES_ROOT\CLSID\{00DFED1F-5A55-4B77-8A05-D128D42EAC6E}
  • HKEY_CLASSES_ROOT\CLSID\{23F85780-FD7B-31AD-BA4B-4863AE67BFD1}
  • HKEY_CLASSES_ROOT\CLSID\{2F151623-5235-3CA5-B82D-AC878960E122}
  • HKEY_CLASSES_ROOT\CLSID\{950808CE-3E2D-47B9-9DFE-4B9F763C7390}
  • HKEY_CLASSES_ROOT\CLSID\{BDCC23B8-3B09-3FFE-B9F3-8E2289339294}
  • HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{00DFED1F-5A55-4B77-8A05-D128D42EAC6E}
  • HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{23F85780-FD7B-31AD-BA4B-4863AE67BFD1}
  • HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{2F151623-5235-3CA5-B82D-AC878960E122}
  • HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{950808CE-3E2D-47B9-9DFE-4B9F763C7390}
  • HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{BDCC23B8-3B09-3FFE-B9F3-8E2289339294}
Lastly, delete the C:\Program Files (x86)\Common Files\SAPIEN Debugger 2017 folder then launch RegisterControls which is located wherever you installed PowerShell Studio (C:\Program Files\SAPIEN Technologies, Inc\PowerShell Studio 2016 by default) and check the available versions.

At this point, you should be able to launch PowerShell Studio and it will run your scripts as expected.
DevinL
SAPIEN Technologies, Inc.