1

I have ARS Shell 1.7.0 installed as part of ARS 6.9 & my MS (windows) powershell version is 4 (obtained by $PSVersionTable.PSVersion, screenshot below)

enter image description here enter image description here

however when I do the same within the PowerGUI I get version as 2? This has started after i upgraded by shell version to 1.7 from 1.6.9 (PowerGUI worked fine with 1.6.9). I have no clue why is this happening & due to this I'm unable to use any quest cmdlets within the PowerGUI editor which make debugging my scripts an impossible task!

Screenshot from PowerGUI :

enter image description here

I get below error when i try to load ActiveRolesManagementShell from PowerGUI:

enter image description here

UPDATE: tried running Powershell (x86) but still the result is same, can anyone please let me know where in the world is PowerGUI picking up version 2 ?

enter image description here

sk8er_boi47
  • 383
  • 1
  • 4
  • 15
  • I know that you run powershell with a downlevel engine version. Is it possible that PowerGUI has a switch or setting somewhere that is doing that? For example: http://stackoverflow.com/questions/13864429/how-to-run-powershell-v3-console-in-v2-mode – Mark Wragg Feb 27 '17 at 08:33
  • Thx for getting back, unfortunately there is no switch for PowerGUI :( – sk8er_boi47 Feb 28 '17 at 12:01
  • Is it possible that you have version 2.0 installed of the 32-bit PowerShell but version 4.0 installed of the 64-bit PowerShell and that explains the difference? Try running the (x86) version of PowerShell and doing $PSVersionTable there to see. – Mark Wragg Feb 28 '17 at 12:04
  • Negative, tried running Powershell(x86) but still it shows version 4, screenshot update din the original post. – sk8er_boi47 Mar 01 '17 at 05:44

2 Answers2

1

Updated the PowerGUI Script editor to version to 3.8 & it resolved the issue. PowerGUI now recognizes v4

People using ver 3.2 should make a note of it.

sk8er_boi47
  • 383
  • 1
  • 4
  • 15
0

I think the issue might be due to a change in ARS 1.7.0 that is forcing the PS2 engine to be required, per this:

Windows PowerShell 4.0 and Windows PowerShell 3.0 are designed to be backwards compatible with Windows PowerShell 2.0. Cmdlets, providers, snap-ins, modules, and scripts written for Windows PowerShell 2.0 run unchanged in Windows PowerShell 4.0 and Windows PowerShell 3.0. However, due to a change in the runtime activation policy in Microsoft .NET Framework 4, Windows PowerShell host programs that were written for Windows PowerShell 2.0 and compiled with Common Language Runtime (CLR) 2.0 cannot run without modification in Windows PowerShell 3.0 or Windows PowerShell 4.0, which are compiled with CLR 4.0. The Windows PowerShell 2.0 Engine is intended to be used only when an existing script or host program cannot run because it is incompatible with Windows PowerShell 4.0, Windows PowerShell 3.0, or Microsoft .NET Framework 4. Such cases are expected to be rare.

Many programs that require the Windows PowerShell 2.0 Engine start it automatically. These instructions are included for the rare situations in which you need to start the engine manually.

Mark Wragg
  • 22,105
  • 7
  • 39
  • 68