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 LICENSE NUMBERS, ACTIVATION 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.
This topic is 6 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
darkprofit
Posts: 15
Last visit: Tue Jan 07, 2020 5:45 am

Cannot instantiate PowerShell V5 object

Post by darkprofit »

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: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Cannot instantiate PowerShell V5 object

Post by Alexander Riedel »

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
Last visit: Tue Jan 07, 2020 5:45 am

Re: Cannot instantiate PowerShell V5 object

Post by darkprofit »

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: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Cannot instantiate PowerShell V5 object

Post by Alexander Riedel »

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
Last visit: Tue Jan 07, 2020 5:45 am

Re: Cannot instantiate PowerShell V5 object

Post by darkprofit »

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: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Cannot instantiate PowerShell V5 object

Post by Alexander Riedel »

Ok, so which powershell version are you trying to use?
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
darkprofit
Posts: 15
Last visit: Tue Jan 07, 2020 5:45 am

Re: Cannot instantiate PowerShell V5 object

Post by darkprofit »

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
Last visit: Tue Jan 07, 2020 5:45 am

Re: Cannot instantiate PowerShell V5 object

Post by darkprofit »

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: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Cannot instantiate PowerShell V5 object

Post by Alexander Riedel »

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
Last visit: Tue Jan 07, 2020 5:45 am

Re: Cannot instantiate PowerShell V5 object

Post by darkprofit »

Sorry no worries. V2 64 Bit
This topic is 6 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.