Page 1 of 1

Primal Script using Powershell V1 not V2

Posted: Thu Aug 13, 2009 1:44 am
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.

Primal Script using Powershell V1 not V2

Posted: Thu Aug 13, 2009 3:38 am
by davidc
We will look into this issue and get back to you as soon as possible.
David

Primal Script using Powershell V1 not V2

Posted: Mon Aug 17, 2009 1:30 am
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

Primal Script using Powershell V1 not V2

Posted: Mon Aug 17, 2009 1:33 am
by windowsadmin@cameco.com
thanks for looking into this. Should I uninstall both versions, and only install the latest?

Primal Script using Powershell V1 not V2

Posted: Mon Aug 17, 2009 1:36 am
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

Primal Script using Powershell V1 not V2

Posted: Wed Aug 19, 2009 3:03 am
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.

Primal Script using Powershell V1 not V2

Posted: Wed Aug 19, 2009 3:31 am
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

Primal Script using Powershell V1 not V2

Posted: Wed Aug 19, 2009 4:42 am
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

Primal Script using Powershell V1 not V2

Posted: Wed Aug 19, 2009 5:14 am
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