Environments - PS5 run as Version 2

Product: PowerShell Universal
Version: 3.8.9

Hello,

I need to run script in ps Version 2.
I’ve created an environment pointing to C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe
with -version 2 as argument.

When I try to run script in this env I get the following error :
[information] LoadFrom : Exception calling “LoadFrom” with “1” argument(s): “Could not load file or assembly ‘file:///C:\Program File
[information] s (x86)\Universal\Host\host.dll’ or one of its dependencies. This assembly is built by a runtime newer than the current
[information] ly loaded runtime and cannot be loaded.”
[information] At line:1 char:43
[information] + & { [System.Reflection.Assembly]::LoadFrom <<<< (‘C:\Program Files (x86)\Universal\Host\host.dll’) | Out-Null; [Unive
[information] rsalHost.AgentService]::StartJob(64438, 7912, $False, 64311) }
[information] + CategoryInfo : NotSpecified: (:slight_smile: , MethodInvocationException
[information] + FullyQualifiedErrorId : DotNetMethodException
[information]
[information] UniversalHost.AgentService : Unable to find type [UniversalHost.AgentService]: make sure that the assembly containing t
[information] his type is loaded.
[information] At line:1 char:134
[information] + & { [System.Reflection.Assembly]::LoadFrom(‘C:\Program Files (x86)\Universal\Host\host.dll’) | Out-Null; [UniversalHo
[information] st.AgentService] <<<< ::StartJob(64438, 7912, $False, 64311) }
[information] + CategoryInfo : InvalidOperation: (UniversalHost.AgentService:String) , RuntimeException
[information] + FullyQualifiedErrorId : TypeNotFound
[information]

Script launched from cmd using -version 2 is working fine.