PowerGUI脚本编辑器无法识别更新的PowerShell版本?

时间:2017-02-27 07:27:01

标签: powershell powergui

我安装了ARS Shell 1.7.0作为ARS 6.9&amp ;;的一部分。我的MS(windows)powershell版本是4(由$ PSVersionTable.PSVersion获得,截图如下)

enter image description here enter image description here

然而,当我在PowerGUI中做同样的事情时,我得到版本为2?这是在我将shell版本从1.6.9升级到1.7之后开始的(PowerGUI在1.6.9下工作正常)。我不知道为什么会发生这种情况。由于这个原因,我无法在PowerGUI编辑器中使用任何任务cmdlet,这使得调试我的脚本成为一项不可能完成的任务!

PowerGUI的屏幕截图:

enter image description here

当我尝试从PowerGUI加载ActiveRolesManagementShell时,我得到以下错误:

enter image description here

更新:尝试运行Powershell(x86),但结果仍然相同,任何人都可以让我知道PowerGUI拿起版本2的世界在哪里?

enter image description here

2 个答案:

答案 0 :(得分:0)

我认为这个问题可能是由于ARS 1.7.0的变化导致需要PS2引擎,这是:

  

Windows PowerShell 4.0和Windows PowerShell 3.0旨在实现   向后兼容Windows PowerShell 2.0。 Cmdlet,提供商,   为Windows PowerShell 2.0编写的管理单元,模块和脚本运行   在Windows PowerShell 4.0和Windows PowerShell 3.0中保持不变。   但是,由于Microsoft中运行时激活策略的更改   .NET Framework 4,Windows PowerShell主机编写的程序   对于Windows PowerShell 2.0并使用公共语言运行时编译   (CLR)2.0无法在Windows PowerShell 3.0或Windows Server中无需修改即可运行   Windows PowerShell 4.0,使用CLR 4.0编译。 Windows   PowerShell 2.0 Engine仅在现有时使用   脚本或主机程序无法运行,因为它与之不兼容   Windows PowerShell 4.0,Windows PowerShell 3.0或Microsoft .NET   框架4. 此类案件预计很少见。

     

许多需要Windows PowerShell 2.0引擎的程序启动它   自动。这些说明包含在极少数情况下   您需要手动启动引擎。

答案 1 :(得分:0)

将PowerGUI脚本编辑器更新为版本 3.8 &它解决了这个问题。 PowerGUI现在识别v4

使用版本3.2的人应该记下它。

相关问题