Cannot instantiate Powershell V5 object

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
froaderick
Posts: 36
Joined: Fri Nov 17, 2006 4:38 am

Re: Cannot instantiate Powershell V5 object

Post by froaderick » Wed Apr 26, 2017 11:29 am

Didnt work.

I do have other Sapien products on my machine. I will try uninstalling everything Sapien using the uninstall cleaner and try again.

User avatar
froaderick
Posts: 36
Joined: Fri Nov 17, 2006 4:38 am

Re: Cannot instantiate Powershell V5 object

Post by froaderick » Wed Apr 26, 2017 11:57 am

Wiped all Sapien products off the PC, ran the Revo Uninstaller Pro for each, removing any stragglers, rebooted, reinstalled Powershell Studio 2016 and still the same thing. I'm at a loss as to what to try next.

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

Re: Cannot instantiate Powershell V5 object

Post by DevinL » Wed Apr 26, 2017 5:03 pm

I've been trying to reproduce this on my end with no luck. The closest I could get one of my machines was a Windows 10 VM running PowerShell 5.1.14393.1066, and when I reinstalled PowerShell Studio 5.2.129 I could execute scripts without issue.

Is it possible the production machine you mentioned earlier is running a different version of PowerShell and this is isolated to the 5.1.14393.953 version installed on your dev machine? If we can narrow it down to a particular build, it will certainly help me in getting this to happen on our end.
DevinL
SAPIEN Technologies, Inc.

User avatar
froaderick
Posts: 36
Joined: Fri Nov 17, 2006 4:38 am

Re: Cannot instantiate Powershell V5 object

Post by froaderick » Fri Apr 28, 2017 4:40 am

I verified that powershell versions are identical.

User avatar
froaderick
Posts: 36
Joined: Fri Nov 17, 2006 4:38 am

Re: Cannot instantiate Powershell V5 object

Post by froaderick » Fri Apr 28, 2017 5:16 am

I also get this error but only when i open PSS and run a script after a reboot
Error.jpg
Error.jpg (31.45 KiB) Viewed 2086 times

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

Re: Cannot instantiate Powershell V5 object

Post by DevinL » Fri Apr 28, 2017 9:15 am

Hey froaderick,

After speaking with the team, we believe the 2nd error you mention regarding The I/O operation... is more of a red herring and unrelated to the Cannot instantiate PowerShell V5... error. The 80070002 error states that a file is missing, and with the steps we've taken, we're positive the necessary object is registered with PowerShell Studio but for some reason, it's unable to find some dependent assembly that it needs to properly execute.

With that being said, we can try to track it down using Fuslogvw from Microsoft: https://msdn.microsoft.com/en-us/librar ... .110).aspx

When you open the tool it should contain an entry for PowerShell Studio and show which files failed to load.
DevinL
SAPIEN Technologies, Inc.

User avatar
froaderick
Posts: 36
Joined: Fri Nov 17, 2006 4:38 am

Re: Cannot instantiate Powershell V5 object

Post by froaderick » Fri Apr 28, 2017 9:28 am

When i run fuslogvw.exe, it is empty.
fuslogvw.jpg
fuslogvw.jpg (46.76 KiB) Viewed 2054 times
I tried closing and re opening PSS with the same result.

User avatar
froaderick
Posts: 36
Joined: Fri Nov 17, 2006 4:38 am

Re: Cannot instantiate Powershell V5 object

Post by froaderick » Fri Apr 28, 2017 9:37 am

Ok, my bad, i forgot to run as admin.

There were two logs:

*** Assembly Binder Log Entry (4/28/2017 @ 12:35:25 PM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable C:\Program Files (x86)\Common Files\SAPIEN Debugger 2016\scriptdriver64Elevated.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: Where-ref bind. Location = C:/Program Files (x86)/Common Files/SAPIEN Debugger 2017/PWSHHelpCtrl2017V5.DLL
LOG: Appbase = file:///C:/Program Files (x86)/Common Files/SAPIEN Debugger 2016/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = scriptdriver64Elevated.exe
Calling assembly : (Unknown).
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Using application configuration file: C:\Program Files (x86)\Common Files\SAPIEN Debugger 2016\ScriptDriver64Elevated.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Common Files/SAPIEN Debugger 2017/PWSHHelpCtrl2017V5.DLL.
LOG: All probing URLs attempted and failed.


and then

*** Assembly Binder Log Entry (4/28/2017 @ 12:35:25 PM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable C:\Program Files (x86)\Common Files\SAPIEN Debugger 2016\scriptdriver64Elevated.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: DisplayName = PWSHHelpCtrl2017V5, Version=5.1.79.0, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/Common Files/SAPIEN Debugger 2016/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = scriptdriver64Elevated.exe
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Download of application configuration file was attempted from file:///C:/Program Files (x86)/Common Files/SAPIEN Debugger 2016/ScriptDriver64Elevated.exe.Config.
LOG: Found application configuration file (C:\Program Files (x86)\Common Files\SAPIEN Debugger 2016\ScriptDriver64Elevated.exe.Config).
LOG: Using application configuration file: C:\Program Files (x86)\Common Files\SAPIEN Debugger 2016\ScriptDriver64Elevated.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Common Files/SAPIEN Debugger 2016/PWSHHelpCtrl2017V5.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Common Files/SAPIEN Debugger 2016/PWSHHelpCtrl2017V5/PWSHHelpCtrl2017V5.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Common Files/SAPIEN Debugger 2016/PWSHHelpCtrl2017V5.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Common Files/SAPIEN Debugger 2016/PWSHHelpCtrl2017V5/PWSHHelpCtrl2017V5.EXE.
LOG: All probing URLs attempted and failed.

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

Re: Cannot instantiate Powershell V5 object

Post by DevinL » Fri Apr 28, 2017 9:43 am

Doing a quick look through the log, it's referring to the previous years' installation as opposed to the current year.

I'll speak with the team and look into this and get back as soon as I have some more information.
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

Post by DevinL » Fri Apr 28, 2017 9:45 am

Quick follow-up as this reminds me of a previous issue we had:

Have you upgraded to 2017 then downgraded to 2016 at any point? Even if it was a simple uninstall and reinstall and you never executed any scripts.
DevinL
SAPIEN Technologies, Inc.