|
|
PowerShell Linux版をインストール |
H.Kamifuji . |
Linux への PowerShell をインストールするには、Linux への PowerShell Core のインストールのページを参照してください。 ここでは、CentOS7 へのインストールと使い方について説明しておきます。 |
先ずは、v6.2.2 Release of PowerShell Coreのページを開き、下記の赤丸部の powershell-6.2.2-1.rhel.7.x86_64.rpm をダウンロードします。![]() ダウンロードした powershell-6.2.2-1.rhel.7.x86_64.rpm を yum コマンドで、インストールします。 [xxxx@yyyyyyy PS-Support]# yum install -y powershell-6.2.2-1.rhel.7.x86_64.rpm 読み込んだプラグイン:fastestmirror, langpacks, priorities powershell-6.2.2-1.rhel.7.x86_64.rpm を調べています: powershell-6.2.2-1.rhel.7.x86_64 powershell-6.2.2-1.rhel.7.x86_64.rpm をインストール済みとして設定しています 依存性の解決をしています --> トランザクションの確認を実行しています。 ---> パッケージ powershell.x86_64 0:6.2.2-1.rhel.7 を インストール --> 依存性解決を終了しました。 依存性を解決しました ==================================================================================================================================== Package アーキテクチャー バージョン リポジトリー 容量 ==================================================================================================================================== インストール中: powershell x86_64 6.2.2-1.rhel.7 /powershell-6.2.2-1.rhel.7.x86_64 151 M トランザクションの要約 ==================================================================================================================================== インストール 1 パッケージ 合計容量: 151 M インストール容量: 151 M Downloading packages: Running transaction check Running transaction test Transaction test succeeded Running transaction インストール中 : powershell-6.2.2-1.rhel.7.x86_64 1/1 検証中 : powershell-6.2.2-1.rhel.7.x86_64 1/1 インストール: powershell.x86_64 0:6.2.2-1.rhel.7 完了しました! [xxxx@yyyyyyy PS-Support]# PowerShell は、pwsh コマンドで起動します。 [xxxx@yyyyyyy PSUX-Support]# pwsh PowerShell 6.2.2 Copyright (c) Microsoft Corporation. All rights reserved. https://aka.ms/pscore6-docs Type 'help' to get help. PS /xxxx/yyyy/PSUX-Support> 取り敢えず、$PSVersionTable で、バージョン情報を見てみよう。 PS /xxxx/yyyy/PSUX-Support> $PSVersionTable Name Value ---- ----- PSVersion 6.2.2 PSEdition Core GitCommitId 6.2.2 OS Linux 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 Platform Unix PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0 PS /xxxx/yyyy/PSUX-Support> |