LoginSignup
2
3

More than 5 years have passed since last update.

Windows7でPowerShell5.xを使う

Last updated at Posted at 2018-10-26

今更必要になる情報でもないと思うけれど、2018の春に新しくWindows7(デフォルトではPowerShell2.0)を使う機会があったので備忘録。
個人的な意見だけど、PowerShell2.0だとできることはかなり限られるので、せめてInvoke-WebRequestとかConvertTo-Jsonとかが使えるPowerShell3.0は欲しい。

なお、順番に1個ずつアップデートしていく必要がある。 (<-誤情報)

追記2 (10/29): (詳細はコメント欄) PowerShell2.0から5.1への飛び級アップデートは特に問題ないとのこと!(3.0からの飛び級は注意が必要)

追記1 (10/27): 要件に合っているのであれば、PowerShell Core 6.1を使う方法もありインストールも楽らしいので使ってみるのもよいかも!

ver3にアップデートする

Windows Power Shell 3.0 を Windows7 にインストールする手順

インストーラ: Download Windows Management Framework 3.0 from Official Microsoft Download Center

ver4にアップデートする

PowerShell/Windows7にPowerShell4.0をインストールする手順

インストーラ: Download Windows Management Framework 4.0 from Official Microsoft Download Center

(win7x86ならWindows6.1-KB2819745-x86-MultiPkg.msu)を実行して再起動する

PS C:\Users\zaki> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      4.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.36450
BuildVersion                   6.3.9600.16406
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion      2.2

ver5にアップデートする

Windows Power Shell をアップデート!Windwos7 に Power Shell 5.1をインストール

インストーラ: Download Windows Management Framework 5.1 from Official Microsoft Download Center

zip(Win7-KB3191566-x86.zip)を落として中のInstall-WMF5.1.ps1を実行して再起動する

PS C:\Users\zaki> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.14409.1005
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14409.1005
CLRVersion                     4.0.30319.36450
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Invoke-WebRequestのhttps接続(TLS1.2)がver3だとうまくいかなくて、もしやと思ってver5までアップデートしたら動いた。(ver4は未確認)

2
3
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3