红联Linux门户
Linux帮助

如何在Linux及OS X系统中安装Microsoft PowerShell

发布时间:2016-08-24 10:17:11来源:sysgeek.cn作者:系统极客
如何在Linux及OS X系统中安装Microsoft PowerShell
PowerShell 已经开源,并对 PowerShell on Linux 进行了简要介绍(http://www.linuxdiyf.com/linux/23574.html),这也引起了不少同时使用微软产品和开源应用的 IT Pro 的兴趣,现在我们就来介绍下如何在 Ubuntu 16.04、Ubuntu 14.04、CentOS 7、Red Hat Enterprise Linux 7 和 OS X 10.11 中下载并安装 PowerShell 软件包。
大家访问 PowerShell 项目在 GitHub 的发布页(https://github.com/PowerShell/PowerShell/releases/)即可下载到各版本系统的安装包:
Ubuntu 16.04:https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.9/powershell_6.0.0-alpha.9-1ubuntu1.16.04.1_amd64.deb
Ubuntu 14.04:https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.9/powershell_6.0.0-alpha.9-1ubuntu1.14.04.1_amd64.deb
CentOS 7/RHEL7:https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.9/powershell-6.0.0_alpha.9-1.el7.centos.x86_64.rpm
OS X 10.11:https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.9/powershell-6.0.0-alpha.9.pkg
如何在Linux及OS X系统中安装Microsoft PowerShell
 
如何安装PowerShell on Linux
请大家自行下载相应系统版本的 PowerShell 安装包,在 Linux 桌面上启动一个终端,再按如下步骤安装相关依赖:
对于 Ubuntu 16.04 系统,请使用如下命令进行安装:
sudo apt-get install libunwind8 libicu55
sudo dpkg -i powershell_6.0.0-alpha.9-1ubuntu1.16.04.1_amd64.deb
如何在Linux及OS X系统中安装Microsoft PowerShell
对于 Ubuntu 14.04 系统,请使用如下命令进行安装:
sudo apt-get install libunwind8 libicu52
sudo dpkg -i powershell_6.0.0-alpha.9-1ubuntu1.14.04.1_amd64.deb
对于 CentOS 7、Oracle Linux 7 和 Red Hat Enterprise Linux 7系统,请使用如下命令进行安装:
sudo yum install powershell-6.0.0_alpha.9-1.el7.centos.x86_64.rpm
 
如何安装PowerShell on a Mac
对于使用 OS X 的用户来说,可以直接双击下载到的 .PKG 包,按向导即可完成安装,也可以使用如下命令在终端中进行安装:
sudo installer -pkg powershell-6.0.0-alpha.9.pkg -target /
如何在Linux及OS X系统中安装Microsoft PowerShell
 
运行PowerShell on Linux或Mac
不论你使用 Linux 还是 OS X,都可以直接在终端中使用 powershell 命令来访问 PowerShell 的 shell 环境。与 Windows 中相同,PowerShell 提示符以「PS」开头。
如何在Linux及OS X系统中安装Microsoft PowerShell
 
本文永久更新地址:http://www.linuxdiyf.com/linux/23575.html