目次
文書の過去の版を表示しています。
PowerShell(Linux)
PowerShell - Windows
本家: PowerShell Documentation | Microsoft Docs
ソースコード: GitHub - PowerShell/PowerShell: PowerShell for every system!
インストール
Releases · PowerShell/PowerShell
https://aka.ms/pscore6
https://aka.ms/pscore6-docs
Releases · PowerShell/PowerShell - Release Candidate 1
Releases · PowerShell/PowerShell - Release Candidate 2
Fedora 31
$ sudo dnf install https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.2/powershell-preview-7.0.0_rc.2-1.centos.8.x86_64.rpm
Fedora - dnf
Fedora への PowerShell のインストール - PowerShell | Microsoft Docs
# Register the Microsoft signature key sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc # Register the Microsoft RedHat repository curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo # Update the list of products sudo dnf check-update # Install a system component sudo dnf install compat-openssl10 # Install PowerShell sudo dnf install -y powershell # Start PowerShell pwsh
$ sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
$ curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 193 100 193 0 0 507 0 --:--:-- --:--:-- --:--:-- 507 [packages-microsoft-com-prod] name=packages-microsoft-com-prod baseurl=https://packages.microsoft.com/rhel/7/prod/ enabled=1 gpgcheck=1 gpgkey=https://packages.microsoft.com/keys/microsoft.asc
PowerShell の実行
$ pwsh
Release Candidate 版の場合
$ pwsh-preview
PowerShell のバージョン
$ Get-Host
Name : ConsoleHost Version : 7.0.0-rc.2 InstanceId : 546f330c-e929-4775-8001-43778f6ce1c7 UI : System.Management.Automation.Internal.Host.InternalHostUserInterface CurrentCulture : ja-JP CurrentUICulture : ja-JP PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy DebuggerEnabled : True IsRunspacePushed : False Runspace : System.Management.Automation.Runspaces.LocalRunspace
$ Get-Host | Select-Object Version
Version ------- 7.0.0-rc.2
$ $PSVersiontable
Name Value ---- ----- PSVersion 7.0.0-rc.2 PSEdition Core GitCommitId 7.0.0-rc.2 OS Linux 5.4.17-200.fc31.x86_64 #1 SMP Sat Feb 1 19:00:13 UTC 2020 Platform Unix PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0