Windows Server 2008 R2 で PowerShell をアップグレードするにはどうすればよいですか?

Windows Server 2008 R2 で 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

答え1

それは不可能です。Windows PowerShell 2.0 は Windows Server 2008 R2 に含まれています。サポートされている方法では、Windows PowerShell 1.0 を 2008 R2 にインストールすることはできません。

実行している 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

答え2

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 ダウンロード センターから Microsoft .NET Framework 4.0 の完全インストール (dotNetFx40_Full_setup.exe) をインストールします。https://go.microsoft.com/fwlink/?LinkID=212547

  3. または、Microsoft ダウンロード センターから Microsoft .NET Framework 4.5 (dotNetFx45_Full_setup.exe) をインストールします。https://go.microsoft.com/fwlink/?LinkID=242919

  4. MicrosoftダウンロードセンターからWindows Management Framework 3.0をインストールします。https://www.microsoft.com/en-us/download/details.aspx?id=34595

このページでは、Server 2008 (R2 以外) および Windows 7 に PowerShell 3.0 をインストールする方法についても説明します。

答え3

PowerShell 4.0Windows Server 2008 R2 で利用できる最終バージョンです。

前提条件は次のとおりです。

これは、Windows 管理フレームワーク 4.0

答え4

現在のバージョンを保持するには、Windows Server 2008 R2 をまだ実行しており、PowerShell 2.0 を使用しているとします。

Windows PowerShell で次のコードを実行します。

Import-Module servermanager
Add-WindowsFeature powershell-ise

関連情報