Page 2 of 3

Re: Cannot instantiate Powershell V5 object

Posted: Wed Apr 26, 2017 11:29 am
by froaderick
Didnt work.

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

Re: Cannot instantiate Powershell V5 object

Posted: Wed Apr 26, 2017 11:57 am
by froaderick
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.

Re: Cannot instantiate Powershell V5 object

Posted: Wed Apr 26, 2017 5:03 pm
by DevinL
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.

Re: Cannot instantiate Powershell V5 object

Posted: Fri Apr 28, 2017 4:40 am
by froaderick
I verified that powershell versions are identical.

Re: Cannot instantiate Powershell V5 object

Posted: Fri Apr 28, 2017 5:16 am
by froaderick
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 2072 times

Re: Cannot instantiate Powershell V5 object

Posted: Fri Apr 28, 2017 9:15 am
by DevinL
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.

Re: Cannot instantiate Powershell V5 object

Posted: Fri Apr 28, 2017 9:28 am
by froaderick
When i run fuslogvw.exe, it is empty.
fuslogvw.jpg
fuslogvw.jpg (46.76 KiB) Viewed 2040 times
I tried closing and re opening PSS with the same result.

Re: Cannot instantiate Powershell V5 object

Posted: Fri Apr 28, 2017 9:37 am
by froaderick
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.

Re: Cannot instantiate Powershell V5 object

Posted: Fri Apr 28, 2017 9:43 am
by DevinL
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.

Re: Cannot instantiate Powershell V5 object

Posted: Fri Apr 28, 2017 9:45 am
by DevinL
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.