Cannot instantiate PowerShell V5 object

Support for all customers who have purchased a SAPIEN PowerShell Studio product license. This forum 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.
User avatar
darkprofit
Posts: 15
Joined: Thu Oct 08, 2015 10:15 am

Cannot instantiate PowerShell V5 object

Post by darkprofit » Fri Nov 10, 2017 9:53 am

To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product, version and build: Powershell Studio 2016 5.2.128
32 or 64 bit version of product:64 Bit
Operating system:
32 or 64 bit OS: 64 Bit Windows 7

Have this issue when try to run or debug any scripts in powershell studio I get the following message "Cannot instantiate Powershell object>> Script Ended". I have tried uninstalling powershell studio and re-installing it. However it still has this issue. This is either on regular scripts or forms. It renders this product unusable.


*** Please add details and screenshots as needed below. ***

DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM

User avatar
Alexander Riedel
Posts: 6361
Joined: Tue May 29, 2007 4:43 pm

Re: Cannot instantiate PowerShell V5 object

Post by Alexander Riedel » Fri Nov 10, 2017 10:30 am

Since this is last years PowerShell Studio and Windows 7, there are some obvious questions:
- Did this work before on this machine or is this a newly setup computer?
- Is PowerShell Version 5 installed on this machine? (Windows 7 comes with PowerShell V2)?
- What .NET runtimes are installed on this computer?
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
darkprofit
Posts: 15
Joined: Thu Oct 08, 2015 10:15 am

Re: Cannot instantiate PowerShell V5 object

Post by darkprofit » Fri Nov 10, 2017 10:44 am

To answer your questions It worked before. Yes Powershell v5 is installed.
Dot net frameworks are 4.5 4.51 4.52 4.6.1

User avatar
Alexander Riedel
Posts: 6361
Joined: Tue May 29, 2007 4:43 pm

Re: Cannot instantiate PowerShell V5 object

Post by Alexander Riedel » Fri Nov 10, 2017 11:15 am

Open a console (elevated) and navigate to this folder:
C:\Program Files (x86)\Common Files\SAPIEN Debugger 2017
Verify that PWSHHelpCtrl2017V5.dll exists.

If so, run the following command:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\regasm.exe PWSHHelpCtrl2017V5.dll /CODEBASE

If the assembly registers successfully, try again. If not, please provide any error messages you see.
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
darkprofit
Posts: 15
Joined: Thu Oct 08, 2015 10:15 am

Re: Cannot instantiate PowerShell V5 object

Post by darkprofit » Mon Nov 13, 2017 12:21 pm

Completed what you sent. Got back the following messages:
RegAsm : warning RA0000 : Registering an unsigned assembly with /codebase can cause your assembly to interfere with other applications that may b
e installed on the same computer. The /codebase switch is intended to be used only with signed assemblies. Please give your assembly a strong nam
e and re-register it.
Types registered successfully

Tried Powershell studio again getting message when running script:
Cannot instantiate PowerShell V2 object: 80070002>> Script Ended

User avatar
Alexander Riedel
Posts: 6361
Joined: Tue May 29, 2007 4:43 pm

Re: Cannot instantiate PowerShell V5 object

Post by Alexander Riedel » Mon Nov 13, 2017 12:26 pm

Ok, so which powershell version are you trying to use?
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
darkprofit
Posts: 15
Joined: Thu Oct 08, 2015 10:15 am

Re: Cannot instantiate PowerShell V5 object

Post by darkprofit » Wed Nov 15, 2017 5:47 am

I am just trying to use Powershell Studio 2016 version 5.2.128 the powershell version on my machine is 5.0.10586.117. When I create a powershell script that simply contains Write-host "This is a test" and try to run it through powershell studio I get the message "Cannot instantiate PowerShell V2 object: 80070002>> Script Ended" I was getting the message "Cannot instantiate PowerShell V5 object". Then followed the instructions you listed above and now I am getting the message Cannot instantiate PowerShell V2 object: 80070002>> Script Ended. Trust me I am not making this up. Please help.

User avatar
darkprofit
Posts: 15
Joined: Thu Oct 08, 2015 10:15 am

Re: Cannot instantiate PowerShell V5 object

Post by darkprofit » Wed Nov 15, 2017 5:50 am

Here is the powershell that is installed on this machine:
PS C:\WINDOWS\System32\WindowsPowerShell\v1.0> $psversiontable

Name Value
---- -----
PSVersion 5.0.10586.117
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.10586.117
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

User avatar
Alexander Riedel
Posts: 6361
Joined: Tue May 29, 2007 4:43 pm

Re: Cannot instantiate PowerShell V5 object

Post by Alexander Riedel » Wed Nov 15, 2017 7:28 am

I am not insinuating you are making anything up. I was asking which powershell version you are trying to use. In other words, which platform and powershell version have you selected in PowerShell Studio on the ribbon?
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
darkprofit
Posts: 15
Joined: Thu Oct 08, 2015 10:15 am

Re: Cannot instantiate PowerShell V5 object

Post by darkprofit » Wed Nov 15, 2017 10:04 am

Sorry no worries. V2 64 Bit