如何在 Windows Server 2008 R2 上升级 PowerShell?

Ani*_*pta 13 powershell

我在 Windows Server 2008 R2 中使用 Windows PowerShell 1.0。我已经在 Windows 8 中尝试过 PowerShell 3.0,对我来说它看起来不错。

现在的问题是:如何在 Windows Server 2008 R2 机器上升级 PowerShell?如果 3.0 对我不可用,那么有什么方法可以升级到最新的可用版本?


Name             : ConsoleHost
Version          : 2.0
InstanceId       : f0b6480c-be55-429d-a197-65604de5887e
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : en-US
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace
Run Code Online (Sandbox Code Playgroud)

Jon*_*n J 33

PowerShell 2.0 包含在 Server 2008 R2 中。PowerShell 3.0 包含在 Windows 8 和 Server 2012 中。PowerShell 3.0 可以安装在 Server 2008 R2 上。

以下说明摘自该页面:http : //technet.microsoft.com/en-us/library/hh847837.aspx

  1. 在安装 Windows Management Framework 3.0 之前,请卸载任何以前版本的 Windows Management Framework 3.0。

  2. 从 Microsoft 下载中心 ( https://go.microsoft.com/fwlink/?LinkID=212547 ) 安装 Microsoft .NET Framework 4.0 (dotNetFx40_Full_setup.exe) 的完整安装。

  3. 或者,从位于https://go.microsoft.com/fwlink/?LinkID=242919的 Microsoft 下载中心安装 Microsoft .NET Framework 4.5 (dotNetFx45_Full_setup.exe) 。

  4. 从位于https://www.microsoft.com/en-us/download/details.aspx?id=34595的 Microsoft 下载中心安装 Windows Management Framework 3.0 。

该页面还介绍了如何在 Server 2008(非 R2)和 Windows 7 上安装 PowerShell 3.0。

  • 当然,这应该是公认的答案......当前接受的答案仅指出“Powershell 1.0 版”错误...... (4认同)

Ale*_*gas 7

PowerShell 4.0是可用于 Windows Server 2008 R2 的最终版本。

先决条件是:

它作为Windows Management Framework 4.0 的一部分安装。


Tre*_*van 5

这不可能。Windows PowerShell 2.0 包含在 Windows Server 2008 R2 中。您不能以任何受支持的方式在 2008 R2 中安装 Windows PowerShell 1.0。

要验证您正在运行的 PowerShell 版本,只需回显$host变量即可。

Name             : Windows PowerShell ISE Host
Version          : 3.0
InstanceId       : 711f19be-3f19-4612-bea3-61899c1a73c2
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : en-US
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.Host.ISE.ISEOptions
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace
Run Code Online (Sandbox Code Playgroud)

  • 这篇文章没有回答 OP 的问题 *如何在 Windows Server 2008 R2 上升级 PowerShell?* (6认同)
  • 是的,你明白了 - 路径仍然显示 v1.0。忽略它:) (3认同)
  • 我觉得你很困惑。Windows Server 2008 R2 SP1 包括开箱即用的 Windows PowerShell 2.0。 (2认同)