安装或设置

Windows

PowerShell 包含在 Windows Management Framework 中。现代版本的 Windows 不需要安装和设置。

可以通过安装较新版本的 Windows Management Framework 来完成对 PowerShell 的更新。

其他平台

PowerShell 6 的 Beta 版本可以安装在其他平台上。安装包可在此处获得

例如,用于 Ubuntu 16.04 的 PowerShell 6 发布到打包存储库以便于安装(和更新)。

要安装,请运行以下命令:

# Import the public repository GPG keys
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -

# Register the Microsoft Ubuntu repository
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list

# Update apt-get
sudo apt-get update

# Install PowerShell
sudo apt-get install -y powershell

# Start PowerShell
powershell

以超级用户身份注册一次 Microsoft 存储库后,你只需要使用 sudo apt-get upgrade powershell 进行更新。然后运行 powershell