プロローグ
Windows Server 2019にWindows Terminalをインストールしたくてあれこれやっていたが、結局OSのバージョンが1809なのでインストールに失敗する。
そこで、Insider Preview版をインストール。バージョン2004である。
GUIも初期のWindows 10相当から2004相当に変更されており、デフォルトのブラウザもInternet ExplorerからEdgeになっている。しかもChronium版。バージョン1809のWindows Server 2019にはEdgeをインストールさえできないのに。
相違点は別途書くかもしれないけど、今回はWindows Terminalのインストール。
目次
必要なもの
Windows ServerにはMicrosoft ストアが無い。
Windows 10ならこう表示されるのに。
そこで必要となるのはパッケージマネージャ。色々調べた中ではMicrosoftが鋭意制作中のwinget(まだプレビュー版)と、
ascii.jp
chocolateyと、
qiita.com
scoopがある。
nodachisoft.com
wingetは残念ながらMicrosoft ストアが無いためWindows Server 2019にはインストール失敗。chocolateyとscoopを比較(少し試した)した結果、今回はscoopにした。
scoopのインストールからWindows Terminalのインストール
Insider PreviewのWindows Server 2019 バージョン2004をインストールし、Windows Updateを掛けて、即scoopをインストールし、そのままの流れで一気にWindows Terminalをインストールした。
scoopのインストール
実行結果は下記の通り。
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
新機能と改善のために最新の PowerShell をインストールしてください!https://aka.ms/PSWindows
PS C:\Users\Administrator>
PS C:\Users\Administrator> Set-ExecutionPolicy RemoteSigned -scope CurrentUser
実行ポリシーの変更
実行ポリシーは、信頼されていないスクリプトからの保護に役立ちます。実行ポリシーを変更すると、about_Execution_Policies
のヘルプ トピック (https://go.microsoft.com/fwlink/?LinkID=135170)
で説明されているセキュリティ上の危険にさらされる可能性があります。実行ポリシーを変更しますか?
[Y] はい(Y) [A] すべて続行(A) [N] いいえ(N) [L] すべて無視(L) [S] 中断(S) [?] ヘルプ (既定値は "N"): A
PS C:\Users\Administrator> iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
Initializing...
Downloading scoop...
Extracting...
Creating shim...
Downloading main bucket...
Extracting...
Adding ~\scoop\shims to your path.
'lastupdate' has been set to '2020-11-28T03:34:05.6652094+09:00'
Scoop was installed successfully!
Type 'scoop help' for instructions.
コマンドレットは2つ。PowerShellの実行ポリシーの変更。
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
2つめは実行したいコマンドレットを文字列として作り込んでから実行するInvoke-Expressionコマンドレット。省略形のiexを使っている。
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
https://get.scoop.sh は実際には
https://raw.githubusercontent.com/lukesampson/scoop/master/bin/install.ps1
にリダイレクトされている。ps1という拡張子を見てわかるようにPowerShellのシェルである。
これでscoopのインストールは完了。
scoopでgitをインストール
scoopはgitを使っているので、その他のインストールをする前にgitをインストールしなければならない。実行結果はこの通り。
PS C:\Users\Administrator> scoop install git
Installing '7zip' (19.00) [64bit]
7z1900-x64.msi (1.7 MB) [=====================================================================================] 100%
Checking hash of 7z1900-x64.msi ... ok.
Extracting 7z1900-x64.msi ... done.
Linking ~\scoop\apps\7zip\current => ~\scoop\apps\7zip\19.00
Creating shim for '7z'.
Creating shortcut for 7-Zip (7zFM.exe)
'7zip' (19.00) was installed successfully!
Installing 'git' (2.29.2.windows.2) [64bit]
PortableGit-2.29.2.2-64-bit.7z.exe (42.6 MB) [================================================================] 100%
Checking hash of PortableGit-2.29.2.2-64-bit.7z.exe ... ok.
Extracting dl.7z ... done.
Linking ~\scoop\apps\git\current => ~\scoop\apps\git\2.29.2.windows.2
Creating shim for 'git'.
Creating shim for 'gitk'.
Creating shim for 'git-gui'.
Creating shim for 'tig'.
Creating shim for 'git-bash'.
Creating shortcut for Git Bash (git-bash.exe)
Creating shortcut for Git GUI (git-gui.exe)
Running post-install script...
'git' (2.29.2.windows.2) was installed successfully!
コマンドはこの通り簡単。
scoop install git
Windows Terminalのインストール
Windows Terminalをインストールする前にBucketを追加する。アプリ群と考えればよい。Windows Terminalの前提となるものが入っている。
qiita.com
一連の実行結果はこの通り。
PS C:\Users\Administrator> scoop bucket add extras
Checking repo... ok
The extras bucket was added successfully.
PS C:\Users\Administrator> scoop install windows-terminal
Installing 'windows-terminal' (1.4.3243.0) [64bit]
Microsoft.WindowsTerminal_1.4.3243.0_8wekyb3d8bbwe.msixbundle (21.8 MB) [=====================================] 100%
Checking hash of Microsoft.WindowsTerminal_1.4.3243.0_8wekyb3d8bbwe.msixbundle ... ok.
Extracting dl.7z ... done.
Running pre-install script...
Running installer script...
Linking ~\scoop\apps\windows-terminal\current => ~\scoop\apps\windows-terminal\1.4.3243.0
Creating shim for 'WindowsTerminal'.
Creating shim for 'wt'.
Creating shortcut for Windows Terminal (WindowsTerminal.exe)
'windows-terminal' (1.4.3243.0) was installed successfully!
'windows-terminal' suggests installing 'extras/vcredist2019'.
bucketの追加。
scoop bucket add extras
そしてWindows Termnalのインストール。
scoop install windows-terminal
以上。これでWindows Terminalはインストールされた。
起動してみる。
上のスタートメニューにも見えているように、最新バージョン7.1.0をインストールしたPowerShellも起動可能。
以上。