Primal Script using Powershell V1 not V2

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.
User avatar
windowsadmin@cameco.com
Posts: 6
Meble kuchenne na zamówienie - na wymiar - Wrocław
Joined: Thu Aug 13, 2009 1:44 am

Primal Script using Powershell V1 not V2

Post by windowsadmin@cameco.com »

I want to use Powershell v2 inside primalscript, and it will only use v1. If I use tools - Powershell it starts a window in v2 but any that I run with F7 uses version1.


How can I fix this.

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Primal Script using Powershell V1 not V2

Post by davidc »

We will look into this issue and get back to you as soon as possible.
David
David
SAPIEN Technologies, Inc.

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Primal Script using Powershell V1 not V2

Post by davidc »

Currently it only supports a single installation of PowerShell. The issue stems from the fact that the PowerShell v1 and v2 assemblies share the same assembly number, thus it causes a problem when the application calls PowerShell. We will look into this further to see if there is a way around this problem.

David
David
SAPIEN Technologies, Inc.

User avatar
windowsadmin@cameco.com
Posts: 6
Joined: Thu Aug 13, 2009 1:44 am

Primal Script using Powershell V1 not V2

Post by windowsadmin@cameco.com »

thanks for looking into this. Should I uninstall both versions, and only install the latest?

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Primal Script using Powershell V1 not V2

Post by davidc »

I think you should be fine uninstalling V1 only, but if you want to play it safe you can remove both versions.

David
David
SAPIEN Technologies, Inc.

User avatar
windowsadmin@cameco.com
Posts: 6
Joined: Thu Aug 13, 2009 1:44 am

Primal Script using Powershell V1 not V2

Post by windowsadmin@cameco.com »

I uninstalled Powershell (there was only 1 shown in the add remove programs) and reinstalled just ctp3, and same result.

I am hoping you have some other ideas. I tried just installing ctp3 and spaien on a different machine and it works correctly.

It seems as if Sapien is using the oldest version on the system, and I don't know how to remove powershell further than the Add/Remove programs option.

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

Primal Script using Powershell V1 not V2

Post by Alexander Riedel »

PrimalScript uses the designated assembly to run PowerShell on a system regardless of PowerShell version.

I suggest you post in a Microsoft powershell forum to obtain information on how to remove old assembly versions.

We will try to do the same from our end.

Alex
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
windowsadmin@cameco.com
Posts: 6
Joined: Thu Aug 13, 2009 1:44 am

Primal Script using Powershell V1 not V2

Post by windowsadmin@cameco.com »

If I use -
Tools - PowerShell it uses v2,
Tools - Program and specify the full path to powersehll it uses version 2, Tools - options - environment - Languages - windows Powershell, and specify the path to powershell.exe it still uses a version 1. something is not right here.

I am running the command $host.version in each of the powershell tests

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

Primal Script using Powershell V1 not V2

Post by Alexander Riedel »

PrimalScript uses the PowerShell engine directly when you run scripts internally. That engine is in an assembly called System.Management.Automation.dll. The V1 version is usually found here:
C:Program FilesReference AssembliesMicrosoftWindowsPowerShellv1.0

We do not specifically use that assembly, but whatever is registered as the powershell engine. I assume that on your machine there is some version/assembly confusion.

I will have to do some research on that matter.

Alex
Alexander Riedel
SAPIEN Technologies, Inc.