如何安装 PowerShell?

Dav*_*end 19 software-installation powershell

不久前,我在 Microsoft 的网站上阅读了有关 PowerShell 可用于 Ubuntu 的内容。

我将如何安装 PowerShell?我很感激XenialTrusty 的指导。

任何安装方法都可以,无论是编译源代码还是依赖包管理器。源代码编译方法应该包含初学者级别的细节。

uSl*_*ckr 14

截至 2017 年 2 月,微软已经通过一个公共存储库提供了这些,它带来了所有存储库的优点。详情请看这里

以下是在 16.04 上安装最新版本 PowerShell 的说明。

# 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 the list of products
sudo apt-get update

# Install PowerShell
sudo apt-get install -y powershell

# Start PowerShell (MS renamed main executable at launch to be more Linux-like)
pwsh
Run Code Online (Sandbox Code Playgroud)


Rin*_*ind 10

有关 debian 安装文件 ('.deb') 和其他下载,请参阅GitHub 上的PowerShell 版本

直接下载链接,带有 SHA256 哈希值:


下载 DEB,验证校验和,然后让 Ubuntu 软件中心负责安装。有关如何验证下载的信息,请参阅help.ubuntu.com。基本上,输入以下命令:

sha256sum powershell_*.deb
Run Code Online (Sandbox Code Playgroud)